53 if (((colObj0) && (!(colObj0)->isStaticOrKinematicObject())) &&
54 ((colObj1) && (!(colObj1)->isStaticOrKinematicObject())))
64 for (i=0;i< numConstraints ; i++ )
72 if (((colObj0) && (!(colObj0)->isStaticOrKinematicObject())) &&
73 ((colObj1) && (!(colObj1)->isStaticOrKinematicObject())))
92 if (((cur) && (!(cur)->isStaticOrKinematicObject())) &&
93 ((prev) && (!(prev)->isStaticOrKinematicObject())))
113 if (tagA>=0 && tagB>=0)
126 BT_PROFILE(
"btMultiBodyDynamicsWorld::updateActivationState");
192 int rIslandId0,lIslandId0;
195 return lIslandId0 < rIslandId0;
207 islandId= islandTagA>=0?islandTagA:islandTagB;
219 int rIslandId0,lIslandId0;
222 return lIslandId0 < rIslandId0;
286 m_solver->
solveMultiBodyGroup( bodies,numBodies,manifolds, numManifolds,
m_sortedConstraints,
m_numConstraints, &
m_multiBodySortedConstraints[0],
m_numConstraints,*
m_solverInfo,
m_debugDrawer,
m_dispatcher);
293 int numCurConstraints = 0;
294 int numCurMultiBodyConstraints = 0;
331 numCurMultiBodyConstraints++;
341 for (i=0;i<numBodies;i++)
343 for (i=0;i<numManifolds;i++)
345 for (i=0;i<numCurConstraints;i++)
348 for (i=0;i<numCurMultiBodyConstraints;i++)
369 m_solver->
solveMultiBodyGroup( bodies,
m_bodies.
size(),manifold,
m_manifolds.
size(),constraints,
m_constraints.
size() ,multiBodyConstraints,
m_multiBodyConstraints.
size(), *
m_solverInfo,
m_debugDrawer,
m_dispatcher);
382 m_multiBodyConstraintSolver(constraintSolver)
435 BT_PROFILE(
"btMultiBody addForce and stepVelocities");
440 bool isSleeping =
false;
490 bool isSleeping =
false;
507 world_to_local.
resize(nLinks+1);
508 local_origin.
resize(nLinks+1);
520 float pos[4]={posr.
x(),posr.
y(),posr.
z(),1};
521 float quat[4]={-world_to_local[0].x(),-world_to_local[0].y(),-world_to_local[0].z(),world_to_local[0].w()};
550 float pos[4]={posr.
x(),posr.
y(),posr.
z(),1};
551 float quat[4]={-world_to_local[index].x(),-world_to_local[index].y(),-world_to_local[index].z(),world_to_local[index].w()};
MultiBodyInplaceSolverIslandCallback & operator=(MultiBodyInplaceSolverIslandCallback &other)
btAlignedObjectArray< btTypedConstraint * > m_constraints
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
virtual void updateActivationState(btScalar timeStep)
void push_back(const T &_Val)
const btMultibodyLink & getLink(int index) const
btSimulationIslandManager * m_islandManager
btAlignedObjectArray< btTypedConstraint * > m_sortedConstraints
class btMultiBodyLinkCollider * m_collider
btIDebugDraw * m_debugDrawer
btDiscreteDynamicsWorld provides discrete rigid body simulation those classes replace the obsolete Cc...
btScalar getBaseMass() const
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size...
void buildAndProcessIslands(btDispatcher *dispatcher, btCollisionWorld *collisionWorld, IslandCallback *callback)
btSimulationIslandManager * getSimulationIslandManager()
#define SIMD_FORCE_INLINE
int getNumCollisionObjects() const
void addLinkForce(int i, const btVector3 &f)
const btCollisionObject * getBody0() const
btMultiBodyConstraintSolver * m_solver
virtual void integrateTransforms(btScalar timeStep)
int btGetMultiBodyConstraintIslandId(const btMultiBodyConstraint *lhs)
virtual void updateActivationState(btCollisionWorld *colWorld, btDispatcher *dispatcher)
btQuaternion inverse(const btQuaternion &q)
Return the inverse of a quaternion.
void clearForcesAndTorques()
const btScalar & x() const
Return the x value.
btVector3 quatRotate(const btQuaternion &rotation, const btVector3 &v)
btDispatcher * m_dispatcher
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 btMulti...
virtual int getIslandIdB() const =0
MultiBodyInplaceSolverIslandCallback * m_solverMultiBodyIslandCallback
btCollisionWorld * getCollisionWorld()
bool operator()(const btMultiBodyConstraint *lhs, const btMultiBodyConstraint *rhs) const
btContactSolverInfo * m_solverInfo
btAlignedObjectArray< btCollisionObject * > m_bodies
void setActivationState(int newState) const
virtual void processIsland(btCollisionObject **bodies, int numBodies, btPersistentManifold **manifolds, int numManifolds, int islandId)
int size() const
return the number of elements in the array
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)
btIDebugDraw * m_debugDrawer
virtual btIDebugDraw * getDebugDrawer()
virtual ~btMultiBodyDynamicsWorld()
virtual void removeMultiBodyConstraint(btMultiBodyConstraint *constraint)
bool operator()(const btTypedConstraint *lhs, const btTypedConstraint *rhs) const
btAlignedObjectArray< btPersistentManifold * > m_manifolds
bool isStaticOrKinematicObject() const
btCollisionObject can be used to manage collision detection objects.
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations...
const btVector3 & getRVector(int i) const
btAlignedObjectArray< btMultiBodyConstraint * > m_multiBodyConstraints
btAlignedObjectArray< btPersistentManifold * > m_predictiveManifolds
The btRigidBody is the main class for rigid body objects.
The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs...
void setDeactivationTime(btScalar time)
void setWorldTransform(const btTransform &worldTrans)
btDispatcher * getDispatcher()
virtual void solveConstraints(btContactSolverInfo &solverInfo)
MultiBodyInplaceSolverIslandCallback(btMultiBodyConstraintSolver *solver, btDispatcher *dispatcher)
const btScalar & y() const
Return the y value.
void checkMotionAndSleepIfRequired(btScalar timestep)
btAlignedObjectArray< btMultiBody * > m_multiBodies
virtual int getIslandIdA() const =0
int m_numMultiBodyConstraints
btVector3 can be used to represent 3D points and vectors.
btMultiBodyConstraint ** m_multiBodySortedConstraints
btAlignedObjectArray< btMultiBodyConstraint * > m_multiBodyConstraints
btMultiBodyDynamicsWorld(btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btMultiBodyConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration)
btScalar getLinkMass(int i) const
void addBaseForce(const btVector3 &f)
virtual int getNumConstraints() const
virtual void allSolved(const btContactSolverInfo &, class btIDebugDraw *)
btAlignedObjectArray< btMultiBodyConstraint * > m_sortedMultiBodyConstraints
virtual void prepareSolve(int, int)
#define WANTS_DEACTIVATION
void remove(const T &key)
virtual void addMultiBody(btMultiBody *body, short group=btBroadphaseProxy::DefaultFilter, short mask=btBroadphaseProxy::AllFilter)
TypedConstraint is the baseclass for Bullet constraints and vehicles.
void resize(int newsize, const T &fillData=T())
virtual void integrateTransforms(btScalar timeStep)
const btRigidBody & getRigidBodyA() const
void setup(btContactSolverInfo *solverInfo, btTypedConstraint **sortedConstraints, int numConstraints, btMultiBodyConstraint **sortedMultiBodyConstraints, int numMultiBodyConstraints, btIDebugDraw *debugDrawer)
virtual void storeIslandActivationState(btCollisionWorld *world)
const btQuaternion & getParentToLocalRot(int i) const
#define DISABLE_DEACTIVATION
virtual void removeMultiBody(btMultiBody *body)
btUnionFind & getUnionFind()
btConstraintSolver * m_constraintSolver
const btMultiBodyLinkCollider * getBaseCollider() const
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
const btQuaternion & getWorldToBaseRot() const
virtual void updateActivationState(btScalar timeStep)
void processConstraints()
void stepPositions(btScalar dt)
int getParent(int link_num) const
btTypedConstraint ** m_sortedConstraints
const btVector3 & getBasePos() const
virtual void addMultiBodyConstraint(btMultiBodyConstraint *constraint)
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
int getActivationState() const
btContactSolverInfo & getSolverInfo()
const btRigidBody & getRigidBodyB() const
const btCollisionObject * getBody1() const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void quickSort(const L &CompareFunc)
int btGetConstraintIslandId2(const btTypedConstraint *lhs)
void stepVelocities(btScalar dt, btAlignedObjectArray< btScalar > &scratch_r, btAlignedObjectArray< btVector3 > &scratch_v, btAlignedObjectArray< btMatrix3x3 > &scratch_m)
virtual void calculateSimulationIslands()
const btScalar & z() const
Return the z value.
btAlignedObjectArray< btTypedConstraint * > m_constraints