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

The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (iterative LCP) method. More...

#include <btSequentialImpulseConstraintSolver.h>

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

Public Member Functions

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

Protected Member Functions

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)
 
virtual void convertContacts (btPersistentManifold **manifoldPtr, int numManifolds, const btContactSolverInfo &infoGlobal)
 
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 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)
 

Static Protected Member Functions

static void applyAnisotropicFriction (btCollisionObject *colObj, btVector3 &frictionDirection, int frictionMode)
 

Protected Attributes

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

Detailed Description

The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (iterative LCP) method.

Definition at line 31 of file btSequentialImpulseConstraintSolver.h.

Constructor & Destructor Documentation

btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver ( )

Definition at line 40 of file btSequentialImpulseConstraintSolver.cpp.

btSequentialImpulseConstraintSolver::~btSequentialImpulseConstraintSolver ( )
virtual

Definition at line 46 of file btSequentialImpulseConstraintSolver.cpp.

Member Function Documentation

btSolverConstraint & btSequentialImpulseConstraintSolver::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,
btScalar  desiredVelocity = 0.,
btScalar  cfmSlip = 0. 
)
protected

Definition at line 440 of file btSequentialImpulseConstraintSolver.cpp.

btSolverConstraint & btSequentialImpulseConstraintSolver::addRollingFrictionConstraint ( 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 
)
protected

Definition at line 527 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::applyAnisotropicFriction ( btCollisionObject colObj,
btVector3 frictionDirection,
int  frictionMode 
)
staticprotected

Definition at line 334 of file btSequentialImpulseConstraintSolver.cpp.

btSequentialImpulseConstraintSolver::BT_DECLARE_ALIGNED_ALLOCATOR ( )
unsigned long btSequentialImpulseConstraintSolver::btRand2 ( )

Definition at line 245 of file btSequentialImpulseConstraintSolver.cpp.

int btSequentialImpulseConstraintSolver::btRandInt2 ( int  n)

Definition at line 254 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::convertContact ( 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 796 of file btSequentialImpulseConstraintSolver.cpp.

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

Reimplemented in btMultiBodyConstraintSolver.

Definition at line 976 of file btSequentialImpulseConstraintSolver.cpp.

int btSequentialImpulseConstraintSolver::getOrInitSolverBody ( btCollisionObject body,
btScalar  timeStep 
)
protected

Definition at line 537 of file btSequentialImpulseConstraintSolver.cpp.

unsigned long btSequentialImpulseConstraintSolver::getRandSeed ( ) const
inline

Definition at line 132 of file btSequentialImpulseConstraintSolver.h.

virtual btConstraintSolverType btSequentialImpulseConstraintSolver::getSolverType ( ) const
inlinevirtual

Implements btConstraintSolver.

Reimplemented in btMLCPSolver.

Definition at line 138 of file btSequentialImpulseConstraintSolver.h.

void btSequentialImpulseConstraintSolver::initSolverBody ( btSolverBody solverBody,
btCollisionObject collisionObject,
btScalar  timeStep 
)
protected

Definition at line 283 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::reset ( )
virtual

clear internal cached data and reset random seed

Implements btConstraintSolver.

Definition at line 1734 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGeneric ( btSolverBody bodyA,
btSolverBody bodyB,
const btSolverConstraint contactConstraint 
)
protected

Definition at line 95 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGenericSIMD ( btSolverBody bodyA,
btSolverBody bodyB,
const btSolverConstraint contactConstraint 
)
protected

Definition at line 61 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimit ( btSolverBody bodyA,
btSolverBody bodyB,
const btSolverConstraint contactConstraint 
)
protected

Definition at line 156 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimitSIMD ( btSolverBody bodyA,
btSolverBody bodyB,
const btSolverConstraint contactConstraint 
)
protected

Definition at line 125 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::resolveSplitPenetrationImpulseCacheFriendly ( btSolverBody bodyA,
btSolverBody bodyB,
const btSolverConstraint contactConstraint 
)
protected

Definition at line 179 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::resolveSplitPenetrationSIMD ( btSolverBody bodyA,
btSolverBody bodyB,
const btSolverConstraint contactConstraint 
)
protected

Definition at line 208 of file btSequentialImpulseConstraintSolver.cpp.

btScalar btSequentialImpulseConstraintSolver::restitutionCurve ( btScalar  rel_vel,
btScalar  restitution 
)
protected

Definition at line 326 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::setFrictionConstraintImpulse ( btSolverConstraint solverConstraint,
int  solverBodyIdA,
int  solverBodyIdB,
btManifoldPoint cp,
const btContactSolverInfo infoGlobal 
)
protected

Definition at line 750 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::setRandSeed ( unsigned long  seed)
inline

Definition at line 128 of file btSequentialImpulseConstraintSolver.h.

void btSequentialImpulseConstraintSolver::setupContactConstraint ( btSolverConstraint solverConstraint,
int  solverBodyIdA,
int  solverBodyIdB,
btManifoldPoint cp,
const btContactSolverInfo infoGlobal,
btScalar relaxation,
const btVector3 rel_pos1,
const btVector3 rel_pos2 
)
protected

warm starting (or zero if disabled)

Definition at line 577 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::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. 
)
protected

Definition at line 354 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::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. 
)
protected

Definition at line 450 of file btSequentialImpulseConstraintSolver.cpp.

btScalar btSequentialImpulseConstraintSolver::solveGroup ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifold,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo info,
btIDebugDraw debugDrawer,
btDispatcher dispatcher 
)
virtual

btSequentialImpulseConstraintSolver Sequentially applies impulses

Implements btConstraintSolver.

Reimplemented in btParallelConstraintSolver, and btMultiBodyConstraintSolver.

Definition at line 1719 of file btSequentialImpulseConstraintSolver.cpp.

btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyFinish ( btCollisionObject **  bodies,
int  numBodies,
const btContactSolverInfo infoGlobal 
)
protectedvirtual

Definition at line 1633 of file btSequentialImpulseConstraintSolver.cpp.

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

this is a special step to resolve penetrations (just for contacts)

Reimplemented in btMLCPSolver.

Definition at line 1613 of file btSequentialImpulseConstraintSolver.cpp.

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

setup the btSolverConstraints

the size of btSolverConstraint needs be a multiple of btScalar

finalize the constraint setup

Reimplemented in btMultiBodyConstraintSolver, and btMLCPSolver.

Definition at line 990 of file btSequentialImpulseConstraintSolver.cpp.

void btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySplitImpulseIterations ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer 
)
protectedvirtual

Definition at line 1573 of file btSequentialImpulseConstraintSolver.cpp.

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

solve all joint constraints, using SIMD, if available

solve all contact constraints using SIMD, if available

solve all friction constraints, using SIMD, if available

solve all joint constraints

solve all contact constraints

solve all friction constraints

Reimplemented in btMultiBodyConstraintSolver.

Definition at line 1335 of file btSequentialImpulseConstraintSolver.cpp.

Member Data Documentation

unsigned long btSequentialImpulseConstraintSolver::m_btSeed2
protected

m_btSeed2 is used for re-arranging the constraint rows. improves convergence/quality of friction

Definition at line 69 of file btSequentialImpulseConstraintSolver.h.

int btSequentialImpulseConstraintSolver::m_fixedBodyId
protected

Definition at line 45 of file btSequentialImpulseConstraintSolver.h.

int btSequentialImpulseConstraintSolver::m_maxOverrideNumSolverIterations
protected

Definition at line 44 of file btSequentialImpulseConstraintSolver.h.

btAlignedObjectArray<int> btSequentialImpulseConstraintSolver::m_orderFrictionConstraintPool
protected

Definition at line 42 of file btSequentialImpulseConstraintSolver.h.

btAlignedObjectArray<int> btSequentialImpulseConstraintSolver::m_orderNonContactConstraintPool
protected

Definition at line 41 of file btSequentialImpulseConstraintSolver.h.

btAlignedObjectArray<int> btSequentialImpulseConstraintSolver::m_orderTmpConstraintPool
protected

Definition at line 40 of file btSequentialImpulseConstraintSolver.h.

btAlignedObjectArray<btTypedConstraint::btConstraintInfo1> btSequentialImpulseConstraintSolver::m_tmpConstraintSizesPool
protected

Definition at line 43 of file btSequentialImpulseConstraintSolver.h.

btAlignedObjectArray<btSolverBody> btSequentialImpulseConstraintSolver::m_tmpSolverBodyPool
protected

Definition at line 34 of file btSequentialImpulseConstraintSolver.h.

btConstraintArray btSequentialImpulseConstraintSolver::m_tmpSolverContactConstraintPool
protected

Definition at line 35 of file btSequentialImpulseConstraintSolver.h.

btConstraintArray btSequentialImpulseConstraintSolver::m_tmpSolverContactFrictionConstraintPool
protected

Definition at line 37 of file btSequentialImpulseConstraintSolver.h.

btConstraintArray btSequentialImpulseConstraintSolver::m_tmpSolverContactRollingFrictionConstraintPool
protected

Definition at line 38 of file btSequentialImpulseConstraintSolver.h.

btConstraintArray btSequentialImpulseConstraintSolver::m_tmpSolverNonContactConstraintPool
protected

Definition at line 36 of file btSequentialImpulseConstraintSolver.h.


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