Newton Dynamics  4.00
ndDynamicsUpdateOpencl.h
1 /* Copyright (c) <2003-2021> <Julio Jerez, Newton Game Dynamics>
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty. In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 *
11 * 1. The origin of this software must not be misrepresented; you must not
12 * claim that you wrote the original software. If you use this software
13 * in a product, an acknowledgment in the product documentation would be
14 * appreciated but is not required.
15 *
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 *
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 #ifndef __D_WORLD_DYNAMICS_UPDATE_OPENCL_H__
23 #define __D_WORLD_DYNAMICS_UPDATE_OPENCL_H__
24 
25 #include "ndNewtonStdafx.h"
26 #include "ndDynamicsUpdate.h"
27 
28 class ndOpenclSystem;
29 
31 {
32  public:
33  ndDynamicsUpdateOpencl(ndWorld* const world, ndInt32 driverNumber);
34  virtual ~ndDynamicsUpdateOpencl();
35 
36  virtual const char* GetStringId() const;
37 
38  protected:
39  virtual void Update();
40 
41  private:
42  void SortJoints();
43  void SortIslands();
44  void BuildIsland();
45  void InitWeights();
46  void InitBodyArray();
47  void InitSkeletons();
48  void CalculateForces();
49  void IntegrateBodies();
50  void UpdateSkeletons();
51  void FinishGpuUpdate();
52  void InitJacobianMatrix();
53  void UpdateForceFeedback();
54  void CalculateJointsForce();
55  void IntegrateBodiesVelocity();
56  void CalculateJointsAcceleration();
57  void IntegrateUnconstrainedBodies();
58 
59  void DetermineSleepStates();
60  void GetJacobianDerivatives(ndConstraint* const joint);
61 
62  ndOpenclSystem* m_opencl;
63 };
64 
65 
66 #endif
67 
ndOpenclSystem
Definition: ndOpenclSystem.h:81
ndDynamicsUpdateOpencl
Definition: ndDynamicsUpdateOpencl.h:31
ndConstraint
Definition: ndConstraint.h:229
ndDynamicsUpdate
Definition: ndDynamicsUpdate.h:45
ndWorld
Definition: ndWorld.h:47