Blender  V3.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btMultiBodyMLCPConstraintSolver Class Reference

#include <btMultiBodyMLCPConstraintSolver.h>

Inheritance diagram for btMultiBodyMLCPConstraintSolver:

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 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 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...
 
btMLCPSolverInterfacem_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...
 

Detailed Description

Definition at line 26 of file btMultiBodyMLCPConstraintSolver.h.

Constructor & Destructor Documentation

◆ btMultiBodyMLCPConstraintSolver()

btMultiBodyMLCPConstraintSolver::btMultiBodyMLCPConstraintSolver ( btMLCPSolverInterface solver)
explicit

Constructor

Parameters
[in]solverMLCP solver. Assumed it's not null.
[in]maxLCPSizeMaximum 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.

◆ ~btMultiBodyMLCPConstraintSolver()

btMultiBodyMLCPConstraintSolver::~btMultiBodyMLCPConstraintSolver ( )
virtual

Destructor.

Definition at line 943 of file btMultiBodyMLCPConstraintSolver.cpp.

Member Function Documentation

◆ createMLCPFast()

void btMultiBodyMLCPConstraintSolver::createMLCPFast ( const btContactSolverInfo infoGlobal)
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().

◆ createMLCPFastMultiBody()

void btMultiBodyMLCPConstraintSolver::createMLCPFastMultiBody ( const btContactSolverInfo infoGlobal)
protected

◆ createMLCPFastRigidBody()

void btMultiBodyMLCPConstraintSolver::createMLCPFastRigidBody ( const btContactSolverInfo infoGlobal)
protected

◆ getNumFallbacks()

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.

◆ getSolverType()

btConstraintSolverType btMultiBodyMLCPConstraintSolver::getSolverType ( ) const
virtual

Returns the constraint solver type.

Definition at line 963 of file btMultiBodyMLCPConstraintSolver.cpp.

References BT_MLCP_SOLVER.

◆ setMLCPSolver()

void btMultiBodyMLCPConstraintSolver::setMLCPSolver ( btMLCPSolverInterface solver)

Sets MLCP solver. Assumed it's not null.

Definition at line 948 of file btMultiBodyMLCPConstraintSolver.cpp.

References m_solver.

◆ setNumFallbacks()

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.

◆ solveGroupCacheFriendlyIterations()

btScalar btMultiBodyMLCPConstraintSolver::solveGroupCacheFriendlyIterations ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer 
)
protected

◆ solveGroupCacheFriendlySetup()

btScalar btMultiBodyMLCPConstraintSolver::solveGroupCacheFriendlySetup ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer 
)
protected

◆ solveMLCP()

bool btMultiBodyMLCPConstraintSolver::solveMLCP ( const btContactSolverInfo infoGlobal)
protectedvirtual

Member Data Documentation

◆ m_A

btMatrixXu btMultiBodyMLCPConstraintSolver::m_A
protected

A matrix in the MLCP formulation.

Definition at line 33 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlySetup(), and solveMLCP().

◆ m_allConstraintPtrArray

btAlignedObjectArray<btSolverConstraint*> btMultiBodyMLCPConstraintSolver::m_allConstraintPtrArray
protected

Array of all the rigid body constraints.

Definition at line 98 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlyIterations(), and solveGroupCacheFriendlySetup().

◆ m_b

btVectorXu btMultiBodyMLCPConstraintSolver::m_b
protected

b vector in the MLCP formulation.

Definition at line 36 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlySetup(), and solveMLCP().

◆ m_bSplit

btVectorXu btMultiBodyMLCPConstraintSolver::m_bSplit
protected

Split impulse Cache vector corresponding to m_b.

Definition at line 54 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody(), and solveMLCP().

◆ m_fallback

int btMultiBodyMLCPConstraintSolver::m_fallback
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().

◆ m_hi

btVectorXu btMultiBodyMLCPConstraintSolver::m_hi
protected

Upper bound of constraint impulse, m_x.

Definition at line 45 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlySetup(), and solveMLCP().

◆ m_limitDependencies

btAlignedObjectArray<int> btMultiBodyMLCPConstraintSolver::m_limitDependencies
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().

◆ m_lo

btVectorXu btMultiBodyMLCPConstraintSolver::m_lo
protected

Lower bound of constraint impulse, m_x.

Definition at line 42 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlySetup(), and solveMLCP().

◆ m_multiBodyA

btMatrixXu btMultiBodyMLCPConstraintSolver::m_multiBodyA
protected

A matrix in the MLCP formulation.

Definition at line 65 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlySetup(), and solveMLCP().

◆ m_multiBodyAllConstraintPtrArray

btAlignedObjectArray<btMultiBodySolverConstraint*> btMultiBodyMLCPConstraintSolver::m_multiBodyAllConstraintPtrArray
protected

Array of all the multibody constraints.

Definition at line 101 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlyIterations(), and solveGroupCacheFriendlySetup().

◆ m_multiBodyB

btVectorXu btMultiBodyMLCPConstraintSolver::m_multiBodyB
protected

b vector in the MLCP formulation.

Definition at line 68 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlySetup(), and solveMLCP().

◆ m_multiBodyHi

btVectorXu btMultiBodyMLCPConstraintSolver::m_multiBodyHi
protected

Upper bound of constraint impulse, m_x.

Definition at line 77 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlySetup(), and solveMLCP().

◆ m_multiBodyLimitDependencies

btAlignedObjectArray<int> btMultiBodyMLCPConstraintSolver::m_multiBodyLimitDependencies
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().

◆ m_multiBodyLo

btVectorXu btMultiBodyMLCPConstraintSolver::m_multiBodyLo
protected

Lower bound of constraint impulse, m_x.

Definition at line 74 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastMultiBody(), solveGroupCacheFriendlySetup(), and solveMLCP().

◆ m_multiBodyX

btVectorXu btMultiBodyMLCPConstraintSolver::m_multiBodyX
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().

◆ m_scratchJ3

btMatrixXu btMultiBodyMLCPConstraintSolver::m_scratchJ3
protected

Cache variable for constraint Jacobian matrix.

Definition at line 117 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody().

◆ m_scratchJInvM3

btMatrixXu btMultiBodyMLCPConstraintSolver::m_scratchJInvM3
protected

Cache variable for constraint Jacobian times inverse mass matrix.

Definition at line 120 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody().

◆ m_scratchOfs

btAlignedObjectArray<int> btMultiBodyMLCPConstraintSolver::m_scratchOfs
protected

Cache variable for offsets.

Definition at line 123 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody().

◆ m_solver

btMLCPSolverInterface* btMultiBodyMLCPConstraintSolver::m_solver
protected

MLCP solver.

Definition at line 104 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by setMLCPSolver(), and solveMLCP().

◆ m_x

btVectorXu btMultiBodyMLCPConstraintSolver::m_x
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().

◆ m_xSplit

btVectorXu btMultiBodyMLCPConstraintSolver::m_xSplit
protected

Split impulse cache vector corresponding to m_x.

Definition at line 57 of file btMultiBodyMLCPConstraintSolver.h.

Referenced by createMLCPFastRigidBody(), solveGroupCacheFriendlyIterations(), and solveMLCP().


The documentation for this class was generated from the following files: