Bullet Collision Detection & Physics Library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btMultiBodyConstraintSolver Class Reference

#include <btMultiBodyConstraintSolver.h>

Inheritance diagram for btMultiBodyConstraintSolver:
Inheritance graph
[legend]
Collaboration diagram for btMultiBodyConstraintSolver:
Collaboration graph
[legend]

Public Member Functions

 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 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 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
 
- Public Member Functions inherited from btConstraintSolver
virtual ~btConstraintSolver ()
 
virtual void prepareSolve (int, int)
 
virtual void allSolved (const btContactSolverInfo &, class btIDebugDraw *)
 

Protected Member Functions

void resolveSingleConstraintRowGeneric (const btMultiBodySolverConstraint &c)
 
void resolveSingleConstraintRowGenericMultiBody (const btMultiBodySolverConstraint &c)
 
void convertContacts (btPersistentManifold **manifoldPtr, int numManifolds, const btContactSolverInfo &infoGlobal)
 
btMultiBodySolverConstraintaddMultiBodyFrictionConstraint (const btVector3 &normalAxis, btPersistentManifold *manifold, int frictionIndex, btManifoldPoint &cp, 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, btManifoldPoint &cp, 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)
 
- Protected Member Functions inherited from btSequentialImpulseConstraintSolver
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, btScalar desiredVelocity=0., btScalar cfmSlip=0.)
 
void setupRollingFrictionConstraint (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, btScalar desiredVelocity=0., btScalar cfmSlip=0.)
 
btSolverConstraintaddFrictionConstraint (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, btScalar desiredVelocity=0., btScalar cfmSlip=0.)
 
btSolverConstraintaddRollingFrictionConstraint (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, 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)
 
void convertContact (btPersistentManifold *manifold, const btContactSolverInfo &infoGlobal)
 
void resolveSplitPenetrationSIMD (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
 
void resolveSplitPenetrationImpulseCacheFriendly (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
 
int getOrInitSolverBody (btCollisionObject &body, btScalar timeStep)
 
void initSolverBody (btSolverBody *solverBody, btCollisionObject *collisionObject, btScalar timeStep)
 
void resolveSingleConstraintRowGeneric (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
 
void resolveSingleConstraintRowGenericSIMD (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
 
void resolveSingleConstraintRowLowerLimit (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
 
void resolveSingleConstraintRowLowerLimitSIMD (btSolverBody &bodyA, btSolverBody &bodyB, const btSolverConstraint &contactConstraint)
 
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 solveGroupCacheFriendlyIterations (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer)
 

Protected Attributes

btMultiBodyConstraintArray m_multiBodyNonContactConstraints
 
btMultiBodyConstraintArray m_multiBodyNormalContactConstraints
 
btMultiBodyConstraintArray m_multiBodyFrictionContactConstraints
 
btMultiBodyJacobianData m_data
 
btMultiBodyConstraint ** m_tmpMultiBodyConstraints
 
int m_tmpNumMultiBodyConstraints
 
- Protected Attributes inherited from btSequentialImpulseConstraintSolver
btAlignedObjectArray
< btSolverBody
m_tmpSolverBodyPool
 
btConstraintArray m_tmpSolverContactConstraintPool
 
btConstraintArray m_tmpSolverNonContactConstraintPool
 
btConstraintArray m_tmpSolverContactFrictionConstraintPool
 
btConstraintArray m_tmpSolverContactRollingFrictionConstraintPool
 
btAlignedObjectArray< int > m_orderTmpConstraintPool
 
btAlignedObjectArray< int > m_orderNonContactConstraintPool
 
btAlignedObjectArray< int > m_orderFrictionConstraintPool
 
btAlignedObjectArray
< btTypedConstraint::btConstraintInfo1
m_tmpConstraintSizesPool
 
int m_maxOverrideNumSolverIterations
 
int m_fixedBodyId
 
unsigned long m_btSeed2
 m_btSeed2 is used for re-arranging the constraint rows. improves convergence/quality of friction More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from btSequentialImpulseConstraintSolver
static void applyAnisotropicFriction (btCollisionObject *colObj, btVector3 &frictionDirection, int frictionMode)
 

Detailed Description

Definition at line 29 of file btMultiBodyConstraintSolver.h.

Member Function Documentation

btMultiBodySolverConstraint & btMultiBodyConstraintSolver::addMultiBodyFrictionConstraint ( const btVector3 normalAxis,
btPersistentManifold manifold,
int  frictionIndex,
btManifoldPoint cp,
btCollisionObject colObj0,
btCollisionObject colObj1,
btScalar  relaxation,
const btContactSolverInfo infoGlobal,
btScalar  desiredVelocity = 0,
btScalar  cfmSlip = 0 
)
protected

Definition at line 530 of file btMultiBodyConstraintSolver.cpp.

void btMultiBodyConstraintSolver::applyDeltaVee ( btScalar deltaV,
btScalar  impulse,
int  velocityIndex,
int  ndof 
)
protected

Definition at line 92 of file btMultiBodyConstraintSolver.cpp.

btMultiBodyConstraintSolver::BT_DECLARE_ALIGNED_ALLOCATOR ( )
void btMultiBodyConstraintSolver::convertContacts ( btPersistentManifold **  manifoldPtr,
int  numManifolds,
const btContactSolverInfo infoGlobal 
)
protectedvirtual

Reimplemented from btSequentialImpulseConstraintSolver.

Definition at line 742 of file btMultiBodyConstraintSolver.cpp.

void btMultiBodyConstraintSolver::convertMultiBodyContact ( btPersistentManifold manifold,
const btContactSolverInfo infoGlobal 
)
protected

avoid collision response between two static objects

Bullet has several options to set the friction directions By default, each contact has only a single friction direction that is recomputed automatically very frame based on the relative linear velocity. If the relative velocity it zero, it will automatically compute a friction direction.

You can also enable two friction directions, using the SOLVER_USE_2_FRICTION_DIRECTIONS. In that case, the second friction direction will be orthogonal to both contact normal and first friction direction.

If you choose SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION, then the friction will be independent from the relative projected velocity.

The user can manually override the friction directions for certain contacts using a contact callback, and set the cp.m_lateralFrictionInitialized to true In that case, you can set the target relative motion in each friction direction (cp.m_contactMotion1 and cp.m_contactMotion2) this will give a conveyor belt effect

Definition at line 562 of file btMultiBodyConstraintSolver.cpp.

void btMultiBodyConstraintSolver::resolveSingleConstraintRowGeneric ( const btMultiBodySolverConstraint c)
protected

Definition at line 98 of file btMultiBodyConstraintSolver.cpp.

void btMultiBodyConstraintSolver::resolveSingleConstraintRowGenericMultiBody ( const btMultiBodySolverConstraint c)
protected

Definition at line 172 of file btMultiBodyConstraintSolver.cpp.

void btMultiBodyConstraintSolver::setupMultiBodyContactConstraint ( btMultiBodySolverConstraint solverConstraint,
const btVector3 contactNormal,
btManifoldPoint cp,
const btContactSolverInfo infoGlobal,
btScalar relaxation,
bool  isFriction,
btScalar  desiredVelocity = 0,
btScalar  cfmSlip = 0 
)
protected

warm starting (or zero if disabled)

Definition at line 228 of file btMultiBodyConstraintSolver.cpp.

void btMultiBodyConstraintSolver::setupMultiBodyJointLimitConstraint ( btMultiBodySolverConstraint constraintRow,
btScalar jacA,
btScalar jacB,
btScalar  penetration,
btScalar  combinedFrictionCoeff,
btScalar  combinedRestitutionCoeff,
const btContactSolverInfo infoGlobal 
)
protected
btScalar btMultiBodyConstraintSolver::solveGroup ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifold,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo info,
btIDebugDraw debugDrawer,
btDispatcher dispatcher 
)
virtual

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)

Reimplemented from btSequentialImpulseConstraintSolver.

Definition at line 777 of file btMultiBodyConstraintSolver.cpp.

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

Reimplemented from btSequentialImpulseConstraintSolver.

Definition at line 69 of file btMultiBodyConstraintSolver.cpp.

void btMultiBodyConstraintSolver::solveMultiBodyGroup ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifold,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
btMultiBodyConstraint **  multiBodyConstraints,
int  numMultiBodyConstraints,
const btContactSolverInfo info,
btIDebugDraw debugDrawer,
btDispatcher dispatcher 
)
virtual

Definition at line 783 of file btMultiBodyConstraintSolver.cpp.

btScalar btMultiBodyConstraintSolver::solveSingleIteration ( int  iteration,
btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer 
)
protectedvirtual

Reimplemented from btSequentialImpulseConstraintSolver.

Definition at line 26 of file btMultiBodyConstraintSolver.cpp.

Member Data Documentation

btMultiBodyJacobianData btMultiBodyConstraintSolver::m_data
protected

Definition at line 39 of file btMultiBodyConstraintSolver.h.

btMultiBodyConstraintArray btMultiBodyConstraintSolver::m_multiBodyFrictionContactConstraints
protected

Definition at line 37 of file btMultiBodyConstraintSolver.h.

btMultiBodyConstraintArray btMultiBodyConstraintSolver::m_multiBodyNonContactConstraints
protected

Definition at line 34 of file btMultiBodyConstraintSolver.h.

btMultiBodyConstraintArray btMultiBodyConstraintSolver::m_multiBodyNormalContactConstraints
protected

Definition at line 36 of file btMultiBodyConstraintSolver.h.

btMultiBodyConstraint** btMultiBodyConstraintSolver::m_tmpMultiBodyConstraints
protected

Definition at line 42 of file btMultiBodyConstraintSolver.h.

int btMultiBodyConstraintSolver::m_tmpNumMultiBodyConstraints
protected

Definition at line 43 of file btMultiBodyConstraintSolver.h.


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