Differential D1739 Diff 5899 extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
Changeset View
Changeset View
Standalone View
Standalone View
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
| Show All 21 Lines | |||||
| class btCollisionObject; | class btCollisionObject; | ||||
| #include "BulletDynamics/ConstraintSolver/btTypedConstraint.h" | #include "BulletDynamics/ConstraintSolver/btTypedConstraint.h" | ||||
| #include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" | #include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" | ||||
| #include "BulletDynamics/ConstraintSolver/btSolverBody.h" | #include "BulletDynamics/ConstraintSolver/btSolverBody.h" | ||||
| #include "BulletDynamics/ConstraintSolver/btSolverConstraint.h" | #include "BulletDynamics/ConstraintSolver/btSolverConstraint.h" | ||||
| #include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h" | #include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h" | ||||
| #include "BulletDynamics/ConstraintSolver/btConstraintSolver.h" | #include "BulletDynamics/ConstraintSolver/btConstraintSolver.h" | ||||
| typedef btSimdScalar(*btSingleConstraintRowSolver)(btSolverBody&, btSolverBody&, const btSolverConstraint&); | |||||
| ///The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (iterative LCP) method. | ///The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (iterative LCP) method. | ||||
| ATTRIBUTE_ALIGNED16(class) btSequentialImpulseConstraintSolver : public btConstraintSolver | ATTRIBUTE_ALIGNED16(class) btSequentialImpulseConstraintSolver : public btConstraintSolver | ||||
| { | { | ||||
| protected: | protected: | ||||
| btAlignedObjectArray<btSolverBody> m_tmpSolverBodyPool; | btAlignedObjectArray<btSolverBody> m_tmpSolverBodyPool; | ||||
| btConstraintArray m_tmpSolverContactConstraintPool; | btConstraintArray m_tmpSolverContactConstraintPool; | ||||
| btConstraintArray m_tmpSolverNonContactConstraintPool; | btConstraintArray m_tmpSolverNonContactConstraintPool; | ||||
| btConstraintArray m_tmpSolverContactFrictionConstraintPool; | btConstraintArray m_tmpSolverContactFrictionConstraintPool; | ||||
| btConstraintArray m_tmpSolverContactRollingFrictionConstraintPool; | btConstraintArray m_tmpSolverContactRollingFrictionConstraintPool; | ||||
| btAlignedObjectArray<int> m_orderTmpConstraintPool; | btAlignedObjectArray<int> m_orderTmpConstraintPool; | ||||
| btAlignedObjectArray<int> m_orderNonContactConstraintPool; | btAlignedObjectArray<int> m_orderNonContactConstraintPool; | ||||
| btAlignedObjectArray<int> m_orderFrictionConstraintPool; | btAlignedObjectArray<int> m_orderFrictionConstraintPool; | ||||
| btAlignedObjectArray<btTypedConstraint::btConstraintInfo1> m_tmpConstraintSizesPool; | btAlignedObjectArray<btTypedConstraint::btConstraintInfo1> m_tmpConstraintSizesPool; | ||||
| int m_maxOverrideNumSolverIterations; | int m_maxOverrideNumSolverIterations; | ||||
| int m_fixedBodyId; | int m_fixedBodyId; | ||||
| btSingleConstraintRowSolver m_resolveSingleConstraintRowGeneric; | |||||
| btSingleConstraintRowSolver m_resolveSingleConstraintRowLowerLimit; | |||||
| void setupFrictionConstraint( btSolverConstraint& solverConstraint, const btVector3& normalAxis,int solverBodyIdA,int solverBodyIdB, | void setupFrictionConstraint( btSolverConstraint& solverConstraint, const btVector3& normalAxis,int solverBodyIdA,int solverBodyIdB, | ||||
| btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2, | btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2, | ||||
| btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, | btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, | ||||
| btScalar desiredVelocity=0., btScalar cfmSlip=0.); | btScalar desiredVelocity=0., btScalar cfmSlip=0.); | ||||
| void setupRollingFrictionConstraint( btSolverConstraint& solverConstraint, const btVector3& normalAxis,int solverBodyIdA,int solverBodyIdB, | void setupRollingFrictionConstraint( btSolverConstraint& solverConstraint, const btVector3& normalAxis,int solverBodyIdA,int solverBodyIdB, | ||||
| btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2, | btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2, | ||||
| btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, | btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
| public: | public: | ||||
| BT_DECLARE_ALIGNED_ALLOCATOR(); | BT_DECLARE_ALIGNED_ALLOCATOR(); | ||||
| btSequentialImpulseConstraintSolver(); | btSequentialImpulseConstraintSolver(); | ||||
| virtual ~btSequentialImpulseConstraintSolver(); | virtual ~btSequentialImpulseConstraintSolver(); | ||||
| virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& info, btIDebugDraw* debugDrawer,btDispatcher* dispatcher); | virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& info, btIDebugDraw* debugDrawer,btDispatcher* dispatcher); | ||||
| ///clear internal cached data and reset random seed | ///clear internal cached data and reset random seed | ||||
| virtual void reset(); | virtual void reset(); | ||||
| unsigned long btRand2(); | unsigned long btRand2(); | ||||
| int btRandInt2 (int n); | int btRandInt2 (int n); | ||||
| void setRandSeed(unsigned long seed) | void setRandSeed(unsigned long seed) | ||||
| { | { | ||||
| m_btSeed2 = seed; | m_btSeed2 = seed; | ||||
| } | } | ||||
| unsigned long getRandSeed() const | unsigned long getRandSeed() const | ||||
| { | { | ||||
| return m_btSeed2; | return m_btSeed2; | ||||
| } | } | ||||
| virtual btConstraintSolverType getSolverType() const | virtual btConstraintSolverType getSolverType() const | ||||
| { | { | ||||
| return BT_SEQUENTIAL_IMPULSE_SOLVER; | return BT_SEQUENTIAL_IMPULSE_SOLVER; | ||||
| } | } | ||||
| btSingleConstraintRowSolver getActiveConstraintRowSolverGeneric() | |||||
| { | |||||
| return m_resolveSingleConstraintRowGeneric; | |||||
| } | |||||
| void setConstraintRowSolverGeneric(btSingleConstraintRowSolver rowSolver) | |||||
| { | |||||
| m_resolveSingleConstraintRowGeneric = rowSolver; | |||||
| } | |||||
| btSingleConstraintRowSolver getActiveConstraintRowSolverLowerLimit() | |||||
| { | |||||
| return m_resolveSingleConstraintRowLowerLimit; | |||||
| } | |||||
| void setConstraintRowSolverLowerLimit(btSingleConstraintRowSolver rowSolver) | |||||
| { | |||||
| m_resolveSingleConstraintRowLowerLimit = rowSolver; | |||||
| } | |||||
| ///Various implementations of solving a single constraint row using a generic equality constraint, using scalar reference, SSE2 or SSE4 | |||||
| btSingleConstraintRowSolver getScalarConstraintRowSolverGeneric(); | |||||
| btSingleConstraintRowSolver getSSE2ConstraintRowSolverGeneric(); | |||||
| btSingleConstraintRowSolver getSSE4_1ConstraintRowSolverGeneric(); | |||||
| ///Various implementations of solving a single constraint row using an inequality (lower limit) constraint, using scalar reference, SSE2 or SSE4 | |||||
| btSingleConstraintRowSolver getScalarConstraintRowSolverLowerLimit(); | |||||
| btSingleConstraintRowSolver getSSE2ConstraintRowSolverLowerLimit(); | |||||
| btSingleConstraintRowSolver getSSE4_1ConstraintRowSolverLowerLimit(); | |||||
| }; | }; | ||||
| #endif //BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H | #endif //BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H | ||||