Bullet Collision Detection & Physics Library
|
#include <btMultiBodyMLCPConstraintSolver.h>
Public Member Functions | |
btMultiBodyMLCPConstraintSolver (btMLCPSolverInterface *solver) | |
Constructor. More... | |
virtual | ~btMultiBodyMLCPConstraintSolver () |
Destructor. More... | |
void | setMLCPSolver (btMLCPSolverInterface *solver) |
Sets MLCP solver. Assumed it's not null. More... | |
int | getNumFallbacks () const |
Returns the number of fallbacks of using btSequentialImpulseConstraintSolver, which happens when the MLCP solver fails. More... | |
void | setNumFallbacks (int num) |
Sets the number of fallbacks. This function may be used to reset the number to zero. More... | |
virtual btConstraintSolverType | getSolverType () const |
Returns the constraint solver type. More... | |
Public Member Functions inherited from btMultiBodyConstraintSolver | |
BT_DECLARE_ALIGNED_ALLOCATOR () | |
virtual btScalar | solveGroup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifold, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &info, btIDebugDraw *debugDrawer, btDispatcher *dispatcher) |
this method should not be called, it was just used during porting/integration of Featherstone btMultiBody, providing backwards compatibility but no support for btMultiBodyConstraint (only contact constraints) More... | |
virtual btScalar | solveGroupCacheFriendlyFinish (btCollisionObject **bodies, int numBodies, const btContactSolverInfo &infoGlobal) |
virtual void | solveMultiBodyGroup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifold, int numManifolds, btTypedConstraint **constraints, int numConstraints, btMultiBodyConstraint **multiBodyConstraints, int numMultiBodyConstraints, const btContactSolverInfo &info, btIDebugDraw *debugDrawer, btDispatcher *dispatcher) |
Public Member Functions inherited from btSequentialImpulseConstraintSolver | |
BT_DECLARE_ALIGNED_ALLOCATOR () | |
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) |
btSequentialImpulseConstraintSolver Sequentially applies impulses More... | |
virtual void | reset () |
clear internal cached data and reset random seed More... | |
unsigned long | btRand2 () |
int | btRandInt2 (int n) |
void | setRandSeed (unsigned long seed) |
unsigned long | getRandSeed () const |
virtual btConstraintSolverType | getSolverType () const |
btSingleConstraintRowSolver | getActiveConstraintRowSolverGeneric () |
void | setConstraintRowSolverGeneric (btSingleConstraintRowSolver rowSolver) |
btSingleConstraintRowSolver | getActiveConstraintRowSolverLowerLimit () |
void | setConstraintRowSolverLowerLimit (btSingleConstraintRowSolver rowSolver) |
btSingleConstraintRowSolver | getScalarConstraintRowSolverGeneric () |
Various implementations of solving a single constraint row using a generic equality constraint, using scalar reference, SSE2 or SSE4. More... | |
btSingleConstraintRowSolver | getSSE2ConstraintRowSolverGeneric () |
btSingleConstraintRowSolver | getSSE4_1ConstraintRowSolverGeneric () |
btSingleConstraintRowSolver | getScalarConstraintRowSolverLowerLimit () |
Various implementations of solving a single constraint row using an inequality (lower limit) constraint, using scalar reference, SSE2 or SSE4. More... | |
btSingleConstraintRowSolver | getSSE2ConstraintRowSolverLowerLimit () |
btSingleConstraintRowSolver | getSSE4_1ConstraintRowSolverLowerLimit () |
Public Member Functions inherited from btConstraintSolver | |
virtual | ~btConstraintSolver () |
virtual void | prepareSolve (int, int) |
virtual btScalar | solveGroup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifold, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &info, class btIDebugDraw *debugDrawer, btDispatcher *dispatcher)=0 |
solve a group of constraints More... | |
virtual void | allSolved (const btContactSolverInfo &, class btIDebugDraw *) |
virtual void | reset ()=0 |
clear internal cached data and reset random seed More... | |
virtual btConstraintSolverType | getSolverType () const =0 |
Protected Member Functions | |
virtual void | createMLCPFast (const btContactSolverInfo &infoGlobal) |
Constructs MLCP terms, which are m_A , m_b , m_lo , and m_hi . More... | |
void | createMLCPFastRigidBody (const btContactSolverInfo &infoGlobal) |
Constructs MLCP terms for constraints of two rigid bodies. More... | |
void | createMLCPFastMultiBody (const btContactSolverInfo &infoGlobal) |
Constructs MLCP terms for constraints of two multi-bodies or one rigid body and one multibody. More... | |
virtual bool | solveMLCP (const btContactSolverInfo &infoGlobal) |
Solves MLCP and returns the success. More... | |
btScalar | solveGroupCacheFriendlySetup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer) BT_OVERRIDE |
btScalar | solveGroupCacheFriendlyIterations (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer) |
Protected Member Functions inherited from btMultiBodyConstraintSolver | |
btScalar | resolveSingleConstraintRowGeneric (const btMultiBodySolverConstraint &c) |
btScalar | resolveConeFrictionConstraintRows (const btMultiBodySolverConstraint &cA1, const btMultiBodySolverConstraint &cB) |
void | convertContacts (btPersistentManifold **manifoldPtr, int numManifolds, const btContactSolverInfo &infoGlobal) |
btMultiBodySolverConstraint & | addMultiBodyFrictionConstraint (const btVector3 &normalAxis, const btScalar &appliedImpulse, btPersistentManifold *manifold, int frictionIndex, btManifoldPoint &cp, btCollisionObject *colObj0, btCollisionObject *colObj1, btScalar relaxation, const btContactSolverInfo &infoGlobal, btScalar desiredVelocity=0, btScalar cfmSlip=0) |
btMultiBodySolverConstraint & | addMultiBodyTorsionalFrictionConstraint (const btVector3 &normalAxis, btPersistentManifold *manifold, int frictionIndex, btManifoldPoint &cp, btScalar combinedTorsionalFriction, btCollisionObject *colObj0, btCollisionObject *colObj1, btScalar relaxation, const btContactSolverInfo &infoGlobal, btScalar desiredVelocity=0, btScalar cfmSlip=0) |
btMultiBodySolverConstraint & | addMultiBodySpinningFrictionConstraint (const btVector3 &normalAxis, btPersistentManifold *manifold, int frictionIndex, btManifoldPoint &cp, btScalar combinedTorsionalFriction, btCollisionObject *colObj0, btCollisionObject *colObj1, btScalar relaxation, const btContactSolverInfo &infoGlobal, btScalar desiredVelocity=0, btScalar cfmSlip=0) |
void | setupMultiBodyJointLimitConstraint (btMultiBodySolverConstraint &constraintRow, btScalar *jacA, btScalar *jacB, btScalar penetration, btScalar combinedFrictionCoeff, btScalar combinedRestitutionCoeff, const btContactSolverInfo &infoGlobal) |
void | setupMultiBodyContactConstraint (btMultiBodySolverConstraint &solverConstraint, const btVector3 &contactNormal, const btScalar &appliedImpulse, btManifoldPoint &cp, const btContactSolverInfo &infoGlobal, btScalar &relaxation, bool isFriction, btScalar desiredVelocity=0, btScalar cfmSlip=0) |
void | setupMultiBodyTorsionalFrictionConstraint (btMultiBodySolverConstraint &solverConstraint, const btVector3 &contactNormal, btManifoldPoint &cp, btScalar combinedTorsionalFriction, const btContactSolverInfo &infoGlobal, btScalar &relaxation, bool isFriction, btScalar desiredVelocity=0, btScalar cfmSlip=0) |
void | convertMultiBodyContact (btPersistentManifold *manifold, const btContactSolverInfo &infoGlobal) |
virtual btScalar | solveGroupCacheFriendlySetup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer) |
virtual btScalar | solveSingleIteration (int iteration, btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer) |
void | applyDeltaVee (btScalar *deltaV, btScalar impulse, int velocityIndex, int ndof) |
void | writeBackSolverBodyToMultiBody (btMultiBodySolverConstraint &constraint, btScalar deltaTime) |
Protected Member Functions inherited from btSequentialImpulseConstraintSolver | |
void | setupSolverFunctions (bool useSimd) |
void | setupFrictionConstraint (btSolverConstraint &solverConstraint, const btVector3 &normalAxis, int solverBodyIdA, int solverBodyIdB, btManifoldPoint &cp, const btVector3 &rel_pos1, const btVector3 &rel_pos2, btCollisionObject *colObj0, btCollisionObject *colObj1, btScalar relaxation, const btContactSolverInfo &infoGlobal, btScalar desiredVelocity=0., btScalar cfmSlip=0.) |
void | setupTorsionalFrictionConstraint (btSolverConstraint &solverConstraint, const btVector3 &normalAxis, int solverBodyIdA, int solverBodyIdB, btManifoldPoint &cp, btScalar combinedTorsionalFriction, const btVector3 &rel_pos1, const btVector3 &rel_pos2, btCollisionObject *colObj0, btCollisionObject *colObj1, btScalar relaxation, btScalar desiredVelocity=0., btScalar cfmSlip=0.) |
btSolverConstraint & | addFrictionConstraint (const btVector3 &normalAxis, int solverBodyIdA, int solverBodyIdB, int frictionIndex, btManifoldPoint &cp, const btVector3 &rel_pos1, const btVector3 &rel_pos2, btCollisionObject *colObj0, btCollisionObject *colObj1, btScalar relaxation, const btContactSolverInfo &infoGlobal, btScalar desiredVelocity=0., btScalar cfmSlip=0.) |
btSolverConstraint & | addTorsionalFrictionConstraint (const btVector3 &normalAxis, int solverBodyIdA, int solverBodyIdB, int frictionIndex, btManifoldPoint &cp, btScalar torsionalFriction, const btVector3 &rel_pos1, const btVector3 &rel_pos2, btCollisionObject *colObj0, btCollisionObject *colObj1, btScalar relaxation, btScalar desiredVelocity=0, btScalar cfmSlip=0.f) |
void | setupContactConstraint (btSolverConstraint &solverConstraint, int solverBodyIdA, int solverBodyIdB, btManifoldPoint &cp, const btContactSolverInfo &infoGlobal, btScalar &relaxation, const btVector3 &rel_pos1, const btVector3 &rel_pos2) |
void | setFrictionConstraintImpulse (btSolverConstraint &solverConstraint, int solverBodyIdA, int solverBodyIdB, btManifoldPoint &cp, const btContactSolverInfo &infoGlobal) |
btScalar | restitutionCurve (btScalar rel_vel, btScalar restitution, btScalar velocityThreshold) |
virtual void | convertContacts (btPersistentManifold **manifoldPtr, int numManifolds, const btContactSolverInfo &infoGlobal) |
void | convertContact (btPersistentManifold *manifold, const btContactSolverInfo &infoGlobal) |
virtual void | convertJoints (btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal) |
void | convertJoint (btSolverConstraint *currentConstraintRow, btTypedConstraint *constraint, const btTypedConstraint::btConstraintInfo1 &info1, int solverBodyIdA, int solverBodyIdB, const btContactSolverInfo &infoGlobal) |
virtual void | convertBodies (btCollisionObject **bodies, int numBodies, const btContactSolverInfo &infoGlobal) |
btScalar | resolveSplitPenetrationSIMD (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint) |
btScalar | resolveSplitPenetrationImpulseCacheFriendly (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint) |
int | getOrInitSolverBody (btCollisionObject &body, btScalar timeStep) |
void | initSolverBody (btSolverBody *solverBody, btCollisionObject *collisionObject, btScalar timeStep) |
btScalar | resolveSingleConstraintRowGeneric (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint) |
btScalar | resolveSingleConstraintRowGenericSIMD (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint) |
btScalar | resolveSingleConstraintRowLowerLimit (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint) |
btScalar | resolveSingleConstraintRowLowerLimitSIMD (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint) |
btScalar | resolveSplitPenetrationImpulse (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint) |
void | writeBackContacts (int iBegin, int iEnd, const btContactSolverInfo &infoGlobal) |
void | writeBackJoints (int iBegin, int iEnd, const btContactSolverInfo &infoGlobal) |
void | writeBackBodies (int iBegin, int iEnd, const btContactSolverInfo &infoGlobal) |
virtual void | solveGroupCacheFriendlySplitImpulseIterations (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer) |
virtual btScalar | solveGroupCacheFriendlyFinish (btCollisionObject **bodies, int numBodies, const btContactSolverInfo &infoGlobal) |
virtual btScalar | solveSingleIteration (int iteration, btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer) |
virtual btScalar | solveGroupCacheFriendlySetup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer) |
virtual btScalar | solveGroupCacheFriendlyIterations (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer) |
Additional Inherited Members | |
Public Attributes inherited from btSequentialImpulseConstraintSolver | |
btSolverAnalyticsData | m_analyticsData |
Static Protected Member Functions inherited from btSequentialImpulseConstraintSolver | |
static void | applyAnisotropicFriction (btCollisionObject *colObj, btVector3 &frictionDirection, int frictionMode) |
Definition at line 26 of file btMultiBodyMLCPConstraintSolver.h.
|
explicit |
Constructor.
[in] | solver | MLCP solver. Assumed it's not null. |
[in] | maxLCPSize | Maximum size of LCP to solve using MLCP solver. If the MLCP size exceeds this number, sequaltial impulse method will be used. |
Definition at line 937 of file btMultiBodyMLCPConstraintSolver.cpp.
|
virtual |
Destructor.
Definition at line 943 of file btMultiBodyMLCPConstraintSolver.cpp.
|
protectedvirtual |
Constructs MLCP terms, which are m_A
, m_b
, m_lo
, and m_hi
.
Definition at line 236 of file btMultiBodyMLCPConstraintSolver.cpp.
|
protected |
Constructs MLCP terms for constraints of two multi-bodies or one rigid body and one multibody.
Definition at line 556 of file btMultiBodyMLCPConstraintSolver.cpp.
|
protected |
Constructs MLCP terms for constraints of two rigid bodies.
fill the upper triangle of the matrix, to make it symmetric
Definition at line 242 of file btMultiBodyMLCPConstraintSolver.cpp.
int btMultiBodyMLCPConstraintSolver::getNumFallbacks | ( | ) | const |
Returns the number of fallbacks of using btSequentialImpulseConstraintSolver, which happens when the MLCP solver fails.
Definition at line 953 of file btMultiBodyMLCPConstraintSolver.cpp.
|
virtual |
Returns the constraint solver type.
Reimplemented from btSequentialImpulseConstraintSolver.
Definition at line 963 of file btMultiBodyMLCPConstraintSolver.cpp.
void btMultiBodyMLCPConstraintSolver::setMLCPSolver | ( | btMLCPSolverInterface * | solver | ) |
Sets MLCP solver. Assumed it's not null.
Definition at line 948 of file btMultiBodyMLCPConstraintSolver.cpp.
void btMultiBodyMLCPConstraintSolver::setNumFallbacks | ( | int | num | ) |
Sets the number of fallbacks. This function may be used to reset the number to zero.
Definition at line 958 of file btMultiBodyMLCPConstraintSolver.cpp.
|
protectedvirtual |
Reimplemented from btSequentialImpulseConstraintSolver.
Definition at line 846 of file btMultiBodyMLCPConstraintSolver.cpp.
|
protectedvirtual |
Reimplemented from btMultiBodyConstraintSolver.
Definition at line 691 of file btMultiBodyMLCPConstraintSolver.cpp.
|
protectedvirtual |
Solves MLCP and returns the success.
Definition at line 657 of file btMultiBodyMLCPConstraintSolver.cpp.
|
protected |
A matrix in the MLCP formulation.
Definition at line 33 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Array of all the rigid body constraints.
Definition at line 98 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
b vector in the MLCP formulation.
Definition at line 36 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Split impulse Cache vector corresponding to m_b
.
Definition at line 54 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Count of fallbacks of using btSequentialImpulseConstraintSolver, which happens when the MLCP solver fails.
Definition at line 107 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Upper bound of constraint impulse, m_x
.
Definition at line 45 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Indices of normal contact constraint associated with frictional contact constraint for rigid bodies.
This is used by the MLCP solver to update the upper bounds of frictional contact impulse given intermediate normal contact impulse. For example, i-th element represents the index of a normal constraint that is accosiated with i-th frictional contact constraint if i-th constraint is a frictional contact constraint. Otherwise, -1.
Definition at line 87 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Lower bound of constraint impulse, m_x
.
Definition at line 42 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
A matrix in the MLCP formulation.
Definition at line 65 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Array of all the multibody constraints.
Definition at line 101 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
b vector in the MLCP formulation.
Definition at line 68 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Upper bound of constraint impulse, m_x
.
Definition at line 77 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Indices of normal contact constraint associated with frictional contact constraint for multibodies.
This is used by the MLCP solver to update the upper bounds of frictional contact impulse given intermediate normal contact impulse. For example, i-th element represents the index of a normal constraint that is accosiated with i-th frictional contact constraint if i-th constraint is a frictional contact constraint. Otherwise, -1.
Definition at line 95 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Lower bound of constraint impulse, m_x
.
Definition at line 74 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Constraint impulse, which is an output of MLCP solving.
Definition at line 71 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Cache variable for constraint Jacobian matrix.
Definition at line 117 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Cache variable for constraint Jacobian times inverse mass matrix.
Definition at line 120 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Cache variable for offsets.
Definition at line 123 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
MLCP solver.
Definition at line 104 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Constraint impulse, which is an output of MLCP solving.
Definition at line 39 of file btMultiBodyMLCPConstraintSolver.h.
|
protected |
Split impulse cache vector corresponding to m_x
.
Definition at line 57 of file btMultiBodyMLCPConstraintSolver.h.