Blender
V3.3
|
#include <btMultiBodyMLCPConstraintSolver.h>
Public Member Functions | |
btMultiBodyMLCPConstraintSolver (btMLCPSolverInterface *solver) | |
virtual | ~btMultiBodyMLCPConstraintSolver () |
Destructor. More... | |
void | setMLCPSolver (btMLCPSolverInterface *solver) |
Sets MLCP solver. Assumed it's not null. More... | |
int | getNumFallbacks () const |
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... | |
Protected Attributes | |
btAlignedObjectArray< int > | m_limitDependencies |
btAlignedObjectArray< int > | m_multiBodyLimitDependencies |
btAlignedObjectArray< btSolverConstraint * > | m_allConstraintPtrArray |
Array of all the rigid body constraints. More... | |
btAlignedObjectArray< btMultiBodySolverConstraint * > | m_multiBodyAllConstraintPtrArray |
Array of all the multibody constraints. More... | |
btMLCPSolverInterface * | m_solver |
MLCP solver. More... | |
int | m_fallback |
Count of fallbacks of using btSequentialImpulseConstraintSolver, which happens when the MLCP solver fails. More... | |
MLCP Formulation for Rigid Bodies | |
btMatrixXu | m_A |
A matrix in the MLCP formulation. More... | |
btVectorXu | m_b |
b vector in the MLCP formulation. More... | |
btVectorXu | m_x |
Constraint impulse, which is an output of MLCP solving. More... | |
btVectorXu | m_lo |
Lower bound of constraint impulse, m_x . More... | |
btVectorXu | m_hi |
Upper bound of constraint impulse, m_x . More... | |
Cache Variables for Split Impulse for Rigid Bodies | |
When using 'split impulse' we solve two separate (M)LCPs | |
btVectorXu | m_bSplit |
Split impulse Cache vector corresponding to m_b . More... | |
btVectorXu | m_xSplit |
Split impulse cache vector corresponding to m_x . More... | |
MLCP Formulation for Multibodies | |
btMatrixXu | m_multiBodyA |
A matrix in the MLCP formulation. More... | |
btVectorXu | m_multiBodyB |
b vector in the MLCP formulation. More... | |
btVectorXu | m_multiBodyX |
Constraint impulse, which is an output of MLCP solving. More... | |
btVectorXu | m_multiBodyLo |
Lower bound of constraint impulse, m_x . More... | |
btVectorXu | m_multiBodyHi |
Upper bound of constraint impulse, m_x . More... | |
MLCP Scratch Variables | |
The following scratch variables are not stateful – contents are cleared prior to each use. They are only cached here to avoid extra memory allocations and deallocations and to ensure that multiple instances of the solver can be run in parallel. | |
btMatrixXu | m_scratchJ3 |
Cache variable for constraint Jacobian matrix. More... | |
btMatrixXu | m_scratchJInvM3 |
Cache variable for constraint Jacobian times inverse mass matrix. More... | |
btAlignedObjectArray< int > | m_scratchOfs |
Cache variable for offsets. More... | |
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.
References createMLCPFastMultiBody(), createMLCPFastRigidBody(), and infoGlobal.
Referenced by solveGroupCacheFriendlySetup().
|
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.
References BT_PROFILE, btFuzzyZero(), btMultiBodySolverConstraint, computeConstraintMatrixDiagElementMultiBody(), computeConstraintMatrixOffDiagElementMultiBody(), infoGlobal, m_data, btContactSolverInfoData::m_globalCfm, m_multiBodyA, m_multiBodyAllConstraintPtrArray, m_multiBodyB, m_multiBodyHi, m_multiBodyLo, m_multiBodyX, btContactSolverInfoData::m_solverMode, btContactSolverInfoData::m_timeStep, btAlignedObjectArray< T >::size(), and SOLVER_USE_WARMSTARTING.
Referenced by createMLCPFast().
|
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.
References BT_INFINITY, BT_PROFILE, btFuzzyZero(), btMatrixXu, btSolverConstraint, btVector3, Freestyle::c, btAlignedObjectArray< T >::expand(), btRigidBody::getInvInertiaTensorWorld(), btRigidBody::getInvMass(), infoGlobal, interleaveContactAndFriction1, m_A, m_allConstraintPtrArray, m_b, m_bSplit, m_contactNormal1, m_contactNormal2, btContactSolverInfoData::m_globalCfm, m_hi, m_lo, m_relpos1CrossNormal, m_relpos2CrossNormal, m_scratchJ3, m_scratchJInvM3, m_scratchOfs, btContactSolverInfoData::m_solverMode, btContactSolverInfoData::m_timeStep, m_tmpConstraintSizesPool, m_tmpSolverNonContactConstraintPool, m_x, m_xSplit, numBodies, r, btAlignedObjectArray< T >::reserve(), btAlignedObjectArray< T >::resize(), btAlignedObjectArray< T >::resizeNoInitialize(), btAlignedObjectArray< T >::size(), and SOLVER_USE_WARMSTARTING.
Referenced by createMLCPFast().
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.
References m_fallback.
|
virtual |
Returns the constraint solver type.
Definition at line 963 of file btMultiBodyMLCPConstraintSolver.cpp.
References BT_MLCP_SOLVER.
void btMultiBodyMLCPConstraintSolver::setMLCPSolver | ( | btMLCPSolverInterface * | solver | ) |
Sets MLCP solver. Assumed it's not null.
Definition at line 948 of file btMultiBodyMLCPConstraintSolver.cpp.
References m_solver.
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.
References m_fallback.
|
protected |
Definition at line 846 of file btMultiBodyMLCPConstraintSolver.cpp.
References applyDeltaVee(), BT_PROFILE, btMultiBody, btMultiBodySolverConstraint, btSolverBody, btSolverConstraint, Freestyle::c, constraints, infoGlobal, m_allConstraintPtrArray, m_data, m_fallback, m_multiBodyAllConstraintPtrArray, m_multiBodyX, btContactSolverInfoData::m_splitImpulse, m_x, m_xSplit, manifoldPtr, numBodies, numConstraints, numManifolds, result, btAlignedObjectArray< T >::size(), solveGroupCacheFriendlyIterations(), and solveMLCP().
|
protected |
Definition at line 691 of file btMultiBodyMLCPConstraintSolver.cpp.
References BT_PROFILE, btMultiBodySolverConstraint, constraints, createMLCPFast(), infoGlobal, interleaveContactAndFriction1, m_A, m_allConstraintPtrArray, m_b, m_hi, m_limitDependencies, m_lo, m_multiBodyA, m_multiBodyAllConstraintPtrArray, m_multiBodyB, m_multiBodyFrictionContactConstraints, m_multiBodyHi, m_multiBodyLimitDependencies, m_multiBodyLo, m_multiBodyNormalContactConstraints, m_multiBodyX, m_tmpSolverContactConstraintPool, m_tmpSolverContactFrictionConstraintPool, m_tmpSolverNonContactConstraintPool, m_x, manifoldPtr, numBodies, numConstraints, numManifolds, btAlignedObjectArray< T >::push_back(), btAlignedObjectArray< T >::resize(), btAlignedObjectArray< T >::size(), and solveGroupCacheFriendlySetup().
|
protectedvirtual |
Solves MLCP and returns the success.
Definition at line 657 of file btMultiBodyMLCPConstraintSolver.cpp.
References btMatrixXu, infoGlobal, m_A, m_b, m_bSplit, m_hi, m_limitDependencies, m_lo, m_multiBodyA, m_multiBodyB, m_multiBodyHi, m_multiBodyLimitDependencies, m_multiBodyLo, m_multiBodyX, btContactSolverInfoData::m_numIterations, m_solver, btContactSolverInfoData::m_splitImpulse, m_x, m_xSplit, result, and btMLCPSolverInterface::solveMLCP().
Referenced by solveGroupCacheFriendlyIterations().
|
protected |
A matrix in the MLCP formulation.
Definition at line 33 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Array of all the rigid body constraints.
Definition at line 98 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlyIterations(), and solveGroupCacheFriendlySetup().
|
protected |
b vector in the MLCP formulation.
Definition at line 36 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Split impulse Cache vector corresponding to m_b
.
Definition at line 54 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody(), and solveMLCP().
|
protected |
Count of fallbacks of using btSequentialImpulseConstraintSolver, which happens when the MLCP solver fails.
Definition at line 107 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by getNumFallbacks(), setNumFallbacks(), and solveGroupCacheFriendlyIterations().
|
protected |
Upper bound of constraint impulse, m_x
.
Definition at line 45 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
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.
Referenced by solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Lower bound of constraint impulse, m_x
.
Definition at line 42 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
A matrix in the MLCP formulation.
Definition at line 65 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Array of all the multibody constraints.
Definition at line 101 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlyIterations(), and solveGroupCacheFriendlySetup().
|
protected |
b vector in the MLCP formulation.
Definition at line 68 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Upper bound of constraint impulse, m_x
.
Definition at line 77 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
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.
Referenced by solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Lower bound of constraint impulse, m_x
.
Definition at line 74 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Constraint impulse, which is an output of MLCP solving.
Definition at line 71 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlyIterations(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Cache variable for constraint Jacobian matrix.
Definition at line 117 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody().
|
protected |
Cache variable for constraint Jacobian times inverse mass matrix.
Definition at line 120 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody().
|
protected |
Cache variable for offsets.
Definition at line 123 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody().
|
protected |
MLCP solver.
Definition at line 104 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by setMLCPSolver(), and solveMLCP().
|
protected |
Constraint impulse, which is an output of MLCP solving.
Definition at line 39 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlyIterations(), solveGroupCacheFriendlySetup(), and solveMLCP().
|
protected |
Split impulse cache vector corresponding to m_x
.
Definition at line 57 of file btMultiBodyMLCPConstraintSolver.h.
Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlyIterations(), and solveMLCP().