22 #ifndef __ND_SKELETON_CONTAINER_H__
23 #define __ND_SKELETON_CONTAINER_H__
25 #include "ndNewtonStdafx.h"
42 for (ndInt32 i = 0; i < ndInt32(
sizeof(m_sourceJacobianIndex)); ++i)
44 m_sourceJacobianIndex[i] = ndInt8(i);
48 ndInt8 m_sourceJacobianIndex[12];
65 } D_GCC_NEWTON_ALIGN_32;
73 } D_GCC_NEWTON_ALIGN_32;
81 } D_GCC_NEWTON_ALIGN_32;
90 inline void CalculateJacobianBlock();
91 inline void CalculateInertiaMatrix(
ndSpatialMatrix*
const bodyMassArray)
const;
96 inline void BodyDiagInvTimeSolution(
ndForcePair& force);
97 inline void JointDiagInvTimeSolution(
ndForcePair& force);
98 inline void JointJacobianTimeMassForward(
ndForcePair& force);
99 inline void BodyJacobianTimeSolutionBackward(
ndForcePair& force)
const;
100 inline ndInt32 GetAuxiliaryRows(
const ndRightHandSide*
const rightHandSide)
const;
113 ndInt8 m_swapJacobianBodiesIndex;
116 class ndNodeList :
public ndList<ndNode, ndContainersFreeListAlloc<ndSkeletonContainer::ndNode> >
129 void CheckSleepState();
134 void InitLoopMassMatrix();
135 void ClearCloseLoopJoints();
137 void CalculateReactionForces(
ndJacobian*
const internalForces);
139 void CalculateBufferSizeInBytes();
140 void ConditionMassMatrix()
const;
141 void SortGraph(
ndNode*
const root, ndInt32& index);
142 void RebuildMassMatrix(
const ndFloat32*
const diagDamp)
const;
143 void CalculateLoopMassMatrixCoefficients(ndFloat32*
const diagDamp);
144 void FactorizeMatrix(ndInt32 size, ndInt32 stride, ndFloat32*
const matrix, ndFloat32*
const diagDamp)
const;
146 void SolveBlockLcp(ndInt32 size, ndInt32 blockSize,
const ndFloat32*
const x0, ndFloat32*
const x, ndFloat32*
const b,
const ndFloat32*
const low,
const ndFloat32*
const high,
const ndInt32*
const normalIndex)
const;
147 void SolveLcp(ndInt32 stride, ndInt32 size,
const ndFloat32*
const matrix,
const ndFloat32*
const x0, ndFloat32*
const x,
const ndFloat32*
const b,
const ndFloat32*
const low,
const ndFloat32*
const high,
const ndInt32*
const normalIndex)
const;
149 inline void SolveBackward(
ndForcePair*
const force)
const;
152 inline void CalculateJointAccel(
const ndJacobian*
const internalForces,
ndForcePair*
const accel)
const;
153 inline void SolveForward(
ndForcePair*
const force,
const ndForcePair*
const accel, ndInt32 startNode)
const;
157 void CalculateJointAccelImmediate(
const ndJacobian*
const internalForces,
ndForcePair*
const accel)
const;
165 ndInt32* m_frictionIndex;
166 ndInt32* m_matrixRowsIndex;
167 ndFloat32* m_massMatrix11;
168 ndFloat32* m_massMatrix10;
169 ndFloat32* m_deltaForce;
177 ndInt32 m_loopRowCount;
178 ndInt32 m_auxiliaryRowCount;
180 ndInt32 m_dynamicsLoopCount;
181 ndUnsigned8 m_isResting;