Newton Dynamics  4.00
ndDynamicsUpdateSoa.h
1 /* Copyright (c) <2003-2022> <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 __ND_WORLD_DYNAMICS_UPDATE_SOA_H__
23 #define __ND_WORLD_DYNAMICS_UPDATE_SOA_H__
24 
25 #include "ndNewtonStdafx.h"
26 #include "ndDynamicsUpdate.h"
27 
28 namespace ndSoa
29 {
31  {
32  public:
33  ndVector m_x;
34  ndVector m_y;
35  ndVector m_z;
36  };
37 
39  {
40  public:
41  ndSoaVector3 m_linear;
42  ndSoaVector3 m_angular;
43  };
44 
46  {
47  public:
48  ndSoaVector6 m_jacobianM0;
49  ndSoaVector6 m_jacobianM1;
50  };
51 
53  {
54  public:
55  ndSoaJacobianPair m_Jt;
56  ndSoaJacobianPair m_JMinv;
57 
58  ndVector m_force;
59  ndVector m_diagDamp;
60  ndVector m_invJinvMJt;
61  ndVector m_coordenateAccel;
62  ndVector m_normalForceIndex;
63  ndVector m_lowerBoundFrictionCoefficent;
64  ndVector m_upperBoundFrictionCoefficent;
65  };
66 };
67 
68 D_MSV_NEWTON_ALIGN_32
70 {
71  public:
72  ndDynamicsUpdateSoa(ndWorld* const world);
73  virtual ~ndDynamicsUpdateSoa();
74 
75  virtual const char* GetStringId() const;
76 
77  protected:
78  virtual void Update();
79 
80  private:
81  void SortJoints();
82  void SortIslands();
83  void BuildIsland();
84  void InitWeights();
85  void InitBodyArray();
86  void InitSkeletons();
87  void CalculateForces();
88  void IntegrateBodies();
89  void UpdateSkeletons();
90  void InitJacobianMatrix();
91  void UpdateForceFeedback();
92  void CalculateJointsForce();
93  void IntegrateBodiesVelocity();
94  void CalculateJointsAcceleration();
95  void IntegrateUnconstrainedBodies();
96 
97  void DetermineSleepStates();
98  void GetJacobianDerivatives(ndConstraint* const joint);
99 
100  ndVector m_ordinals;
101  ndArray<ndInt8> m_groupType;
102  ndArray<ndVector> m_jointMask;
103  ndArray<ndInt32> m_soaJointRows;
104  ndArray<ndSoa::ndSoaMatrixElement> m_soaMassMatrix;
105 
106 } D_GCC_NEWTON_ALIGN_32;
107 
108 #endif
109 
ndSoa::ndSoaVector3
Definition: ndDynamicsUpdateSoa.h:31
ndArray< ndInt8 >
ndDynamicsUpdateSoa
Definition: ndDynamicsUpdateSoa.h:70
ndConstraint
Definition: ndConstraint.h:229
ndSoa::ndSoaVector6
Definition: ndDynamicsUpdateSoa.h:39
ndSoa::ndSoaMatrixElement
Definition: ndDynamicsUpdateSoa.h:53
ndDynamicsUpdate
Definition: ndDynamicsUpdate.h:45
ndSoa::ndSoaJacobianPair
Definition: ndDynamicsUpdateSoa.h:46
ndVector
Definition: ndVectorArmNeon.h:41
ndWorld
Definition: ndWorld.h:47