Blender V2.61 - r43446
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

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]

List of all members.

Public Member Functions

 btSequentialImpulseConstraintSolver ()
virtual ~btSequentialImpulseConstraintSolver ()
virtual btScalar solveGroup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifold, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &info, btIDebugDraw *debugDrawer, btStackAlloc *stackAlloc, btDispatcher *dispatcher)
 btSequentialImpulseConstraintSolver Sequentially applies impulses
virtual void reset ()
 clear internal cached data and reset random seed
unsigned long btRand2 ()
int btRandInt2 (int n)
void setRandSeed (unsigned long seed)
unsigned long getRandSeed () const

Protected Member Functions

void setupFrictionConstraint (btSolverConstraint &solverConstraint, const btVector3 &normalAxis, btRigidBody *solverBodyA, btRigidBody *solverBodyIdB, btManifoldPoint &cp, 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, btRigidBody *solverBodyA, btRigidBody *solverBodyB, int frictionIndex, btManifoldPoint &cp, const btVector3 &rel_pos1, const btVector3 &rel_pos2, btCollisionObject *colObj0, btCollisionObject *colObj1, btScalar relaxation, btScalar desiredVelocity=0., btScalar cfmSlip=0.)
void setupContactConstraint (btSolverConstraint &solverConstraint, btCollisionObject *colObj0, btCollisionObject *colObj1, btManifoldPoint &cp, const btContactSolverInfo &infoGlobal, btVector3 &vel, btScalar &rel_vel, btScalar &relaxation, btVector3 &rel_pos1, btVector3 &rel_pos2)
void setFrictionConstraintImpulse (btSolverConstraint &solverConstraint, btRigidBody *rb0, btRigidBody *rb1, btManifoldPoint &cp, const btContactSolverInfo &infoGlobal)
btScalar restitutionCurve (btScalar rel_vel, btScalar restitution)
void convertContact (btPersistentManifold *manifold, const btContactSolverInfo &infoGlobal)
void resolveSplitPenetrationSIMD (btRigidBody &body1, btRigidBody &body2, const btSolverConstraint &contactConstraint)
void resolveSplitPenetrationImpulseCacheFriendly (btRigidBody &body1, btRigidBody &body2, const btSolverConstraint &contactConstraint)
int getOrInitSolverBody (btCollisionObject &body)
void resolveSingleConstraintRowGeneric (btRigidBody &body1, btRigidBody &body2, const btSolverConstraint &contactConstraint)
void resolveSingleConstraintRowGenericSIMD (btRigidBody &body1, btRigidBody &body2, const btSolverConstraint &contactConstraint)
void resolveSingleConstraintRowLowerLimit (btRigidBody &body1, btRigidBody &body2, const btSolverConstraint &contactConstraint)
void resolveSingleConstraintRowLowerLimitSIMD (btRigidBody &body1, btRigidBody &body2, const btSolverConstraint &contactConstraint)
virtual void solveGroupCacheFriendlySplitImpulseIterations (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer, btStackAlloc *stackAlloc)
virtual btScalar solveGroupCacheFriendlyFinish (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer, btStackAlloc *stackAlloc)
btScalar solveSingleIteration (int iteration, btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer, btStackAlloc *stackAlloc)
virtual btScalar solveGroupCacheFriendlySetup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer, btStackAlloc *stackAlloc)
virtual btScalar solveGroupCacheFriendlyIterations (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifoldPtr, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &infoGlobal, btIDebugDraw *debugDrawer, btStackAlloc *stackAlloc)

Static Protected Member Functions

static btRigidBodygetFixedBody ()

Protected Attributes

btConstraintArray m_tmpSolverContactConstraintPool
btConstraintArray m_tmpSolverNonContactConstraintPool
btConstraintArray m_tmpSolverContactFrictionConstraintPool
btAlignedObjectArray< int > m_orderTmpConstraintPool
btAlignedObjectArray< int > m_orderFrictionConstraintPool
btAlignedObjectArray
< btTypedConstraint::btConstraintInfo1
m_tmpConstraintSizesPool
unsigned long m_btSeed2
 m_btSeed2 is used for re-arranging the constraint rows. improves convergence/quality of friction

Detailed Description

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

Definition at line 28 of file btSequentialImpulseConstraintSolver.h.


Constructor & Destructor Documentation

btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver ( )

Definition at line 39 of file btSequentialImpulseConstraintSolver.cpp.

btSequentialImpulseConstraintSolver::~btSequentialImpulseConstraintSolver ( ) [virtual]

Definition at line 45 of file btSequentialImpulseConstraintSolver.cpp.


Member Function Documentation

btSolverConstraint & btSequentialImpulseConstraintSolver::addFrictionConstraint ( const btVector3 &  normalAxis,
btRigidBody solverBodyA,
btRigidBody solverBodyB,
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]
unsigned long btSequentialImpulseConstraintSolver::btRand2 ( )

Definition at line 243 of file btSequentialImpulseConstraintSolver.cpp.

References L, and m_btSeed2.

Referenced by btRandInt2().

int btSequentialImpulseConstraintSolver::btRandInt2 ( int  n)

Definition at line 252 of file btSequentialImpulseConstraintSolver.cpp.

References btRand2().

Referenced by solveSingleIteration().

void btSequentialImpulseConstraintSolver::convertContact ( btPersistentManifold *  manifold,
const btContactSolverInfo infoGlobal 
) [protected]
btRigidBody & btSequentialImpulseConstraintSolver::getFixedBody ( ) [static, protected]
int btSequentialImpulseConstraintSolver::getOrInitSolverBody ( btCollisionObject &  body) [protected]
unsigned long btSequentialImpulseConstraintSolver::getRandSeed ( ) const [inline]

Definition at line 115 of file btSequentialImpulseConstraintSolver.h.

References m_btSeed2.

void btSequentialImpulseConstraintSolver::reset ( ) [virtual]

clear internal cached data and reset random seed

Implements btConstraintSolver.

Definition at line 1206 of file btSequentialImpulseConstraintSolver.cpp.

References m_btSeed2.

void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGeneric ( btRigidBody body1,
btRigidBody body2,
const btSolverConstraint &  contactConstraint 
) [protected]
void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGenericSIMD ( btRigidBody body1,
btRigidBody body2,
const btSolverConstraint &  contactConstraint 
) [protected]
void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimit ( btRigidBody body1,
btRigidBody body2,
const btSolverConstraint &  contactConstraint 
) [protected]
void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimitSIMD ( btRigidBody body1,
btRigidBody body2,
const btSolverConstraint &  contactConstraint 
) [protected]
void btSequentialImpulseConstraintSolver::resolveSplitPenetrationImpulseCacheFriendly ( btRigidBody body1,
btRigidBody body2,
const btSolverConstraint &  contactConstraint 
) [protected]
void btSequentialImpulseConstraintSolver::resolveSplitPenetrationSIMD ( btRigidBody body1,
btRigidBody body2,
const btSolverConstraint &  contactConstraint 
) [protected]
btScalar btSequentialImpulseConstraintSolver::restitutionCurve ( btScalar  rel_vel,
btScalar  restitution 
) [protected]

Definition at line 308 of file btSequentialImpulseConstraintSolver.cpp.

Referenced by setupContactConstraint().

void btSequentialImpulseConstraintSolver::setFrictionConstraintImpulse ( btSolverConstraint &  solverConstraint,
btRigidBody rb0,
btRigidBody rb1,
btManifoldPoint cp,
const btContactSolverInfo infoGlobal 
) [protected]
void btSequentialImpulseConstraintSolver::setRandSeed ( unsigned long  seed) [inline]

Definition at line 111 of file btSequentialImpulseConstraintSolver.h.

References m_btSeed2.

void btSequentialImpulseConstraintSolver::setupContactConstraint ( btSolverConstraint &  solverConstraint,
btCollisionObject *  colObj0,
btCollisionObject *  colObj1,
btManifoldPoint cp,
const btContactSolverInfo infoGlobal,
btVector3 &  vel,
btScalar rel_vel,
btScalar relaxation,
btVector3 &  rel_pos1,
btVector3 &  rel_pos2 
) [protected]
void btSequentialImpulseConstraintSolver::setupFrictionConstraint ( btSolverConstraint &  solverConstraint,
const btVector3 &  normalAxis,
btRigidBody solverBodyA,
btRigidBody solverBodyIdB,
btManifoldPoint cp,
const btVector3 &  rel_pos1,
const btVector3 &  rel_pos2,
btCollisionObject *  colObj0,
btCollisionObject *  colObj1,
btScalar  relaxation,
btScalar  desiredVelocity = 0.,
btScalar  cfmSlip = 0. 
) [protected]
btScalar btSequentialImpulseConstraintSolver::solveGroup ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifold,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo info,
btIDebugDraw debugDrawer,
btStackAlloc stackAlloc,
btDispatcher dispatcher 
) [virtual]
btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyFinish ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer,
btStackAlloc stackAlloc 
) [protected, virtual]
btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyIterations ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer,
btStackAlloc stackAlloc 
) [protected, virtual]
btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer,
btStackAlloc stackAlloc 
) [protected, virtual]

setup the btSolverConstraints

the size of btSolverConstraint needs be a multiple of btScalar

finalize the constraint setup

fix rhs todo: add force/torque accelerators

Todo:
: use stack allocator for such temporarily memory, same for solver bodies/constraints

Definition at line 744 of file btSequentialImpulseConstraintSolver.cpp.

References BT_PROFILE, btAssert, btTypedConstraint::buildJacobian(), btTypedConstraint::btConstraintInfo2::cfm, convertContact(), btTypedConstraint::btConstraintInfo2::erp, FLT_MAX, btTypedConstraint::btConstraintInfo2::fps, btRigidBody::getAngularFactor(), btRigidBody::getAngularVelocity(), btTypedConstraint::getInfo1(), btTypedConstraint::getInfo2(), btRigidBody::getInvInertiaTensorWorld(), btRigidBody::getInvMass(), btRigidBody::getLinearVelocity(), btTypedConstraint::getRigidBodyA(), btTypedConstraint::getRigidBodyB(), i, btRigidBody::internalGetDeltaAngularVelocity(), btRigidBody::internalGetDeltaLinearVelocity(), btRigidBody::internalGetPushVelocity(), btRigidBody::internalGetTurnVelocity(), btTypedConstraint::btConstraintInfo2::m_constraintError, btContactSolverInfoData::m_damping, btTypedConstraint::btConstraintInfo2::m_damping, btContactSolverInfoData::m_erp, btContactSolverInfoData::m_globalCfm, btTypedConstraint::btConstraintInfo2::m_J1angularAxis, btTypedConstraint::btConstraintInfo2::m_J1linearAxis, btTypedConstraint::btConstraintInfo2::m_J2angularAxis, btTypedConstraint::btConstraintInfo2::m_J2linearAxis, btTypedConstraint::btConstraintInfo2::m_lowerLimit, btTypedConstraint::btConstraintInfo1::m_numConstraintRows, btTypedConstraint::btConstraintInfo2::m_numIterations, btContactSolverInfoData::m_numIterations, m_orderFrictionConstraintPool, m_orderTmpConstraintPool, btContactSolverInfoData::m_splitImpulse, btContactSolverInfoData::m_timeStep, m_tmpConstraintSizesPool, m_tmpSolverContactConstraintPool, m_tmpSolverContactFrictionConstraintPool, m_tmpSolverNonContactConstraintPool, btTypedConstraint::btConstraintInfo2::m_upperLimit, btAlignedObjectArray< T >::resize(), btTypedConstraint::btConstraintInfo2::rowskip, btAlignedObjectArray< T >::size(), and sum().

Referenced by solveGroup().

void btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySplitImpulseIterations ( btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer,
btStackAlloc stackAlloc 
) [protected, virtual]
btScalar btSequentialImpulseConstraintSolver::solveSingleIteration ( int  iteration,
btCollisionObject **  bodies,
int  numBodies,
btPersistentManifold **  manifoldPtr,
int  numManifolds,
btTypedConstraint **  constraints,
int  numConstraints,
const btContactSolverInfo infoGlobal,
btIDebugDraw debugDrawer,
btStackAlloc stackAlloc 
) [protected]

Member Data Documentation

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

Definition at line 54 of file btSequentialImpulseConstraintSolver.h.

Referenced by btRand2(), getRandSeed(), reset(), and setRandSeed().

Definition at line 37 of file btSequentialImpulseConstraintSolver.h.

Referenced by solveGroupCacheFriendlySetup().


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