Blender V2.61 - r43446
|
#include <btDiscreteDynamicsWorld.h>
Public Member Functions | |
btDiscreteDynamicsWorld (btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration) | |
this btDiscreteDynamicsWorld constructor gets created objects from the user, and will not delete those | |
virtual | ~btDiscreteDynamicsWorld () |
virtual int | stepSimulation (btScalar timeStep, int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.)) |
if maxSubSteps > 0, it will interpolate motion between fixedTimeStep's | |
virtual void | synchronizeMotionStates () |
void | synchronizeSingleMotionState (btRigidBody *body) |
this can be useful to synchronize a single rigid body -> graphics object | |
virtual void | addConstraint (btTypedConstraint *constraint, bool disableCollisionsBetweenLinkedBodies=false) |
virtual void | removeConstraint (btTypedConstraint *constraint) |
virtual void | addAction (btActionInterface *) |
virtual void | removeAction (btActionInterface *) |
btSimulationIslandManager * | getSimulationIslandManager () |
const btSimulationIslandManager * | getSimulationIslandManager () const |
btCollisionWorld * | getCollisionWorld () |
virtual void | setGravity (const btVector3 &gravity) |
virtual btVector3 | getGravity () const |
virtual void | addCollisionObject (btCollisionObject *collisionObject, short int collisionFilterGroup=btBroadphaseProxy::StaticFilter, short int collisionFilterMask=btBroadphaseProxy::AllFilter^btBroadphaseProxy::StaticFilter) |
virtual void | addRigidBody (btRigidBody *body) |
virtual void | addRigidBody (btRigidBody *body, short group, short mask) |
virtual void | removeRigidBody (btRigidBody *body) |
virtual void | removeCollisionObject (btCollisionObject *collisionObject) |
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject | |
void | debugDrawConstraint (btTypedConstraint *constraint) |
virtual void | debugDrawWorld () |
virtual void | setConstraintSolver (btConstraintSolver *solver) |
virtual btConstraintSolver * | getConstraintSolver () |
virtual int | getNumConstraints () const |
virtual btTypedConstraint * | getConstraint (int index) |
virtual const btTypedConstraint * | getConstraint (int index) const |
virtual btDynamicsWorldType | getWorldType () const |
virtual void | clearForces () |
the forces on each rigidbody is accumulating together with gravity. clear this after each timestep. | |
virtual void | applyGravity () |
apply gravity, call this once per timestep | |
virtual void | setNumTasks (int numTasks) |
virtual void | updateVehicles (btScalar timeStep) |
obsolete, use updateActions instead | |
virtual void | addVehicle (btActionInterface *vehicle) |
obsolete, use addAction instead | |
virtual void | removeVehicle (btActionInterface *vehicle) |
obsolete, use removeAction instead | |
virtual void | addCharacter (btActionInterface *character) |
obsolete, use addAction instead | |
virtual void | removeCharacter (btActionInterface *character) |
obsolete, use removeAction instead | |
void | setSynchronizeAllMotionStates (bool synchronizeAll) |
bool | getSynchronizeAllMotionStates () const |
virtual void | serialize (btSerializer *serializer) |
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see Bullet/Demos/SerializeDemo) | |
Protected Member Functions | |
virtual void | predictUnconstraintMotion (btScalar timeStep) |
virtual void | integrateTransforms (btScalar timeStep) |
virtual void | calculateSimulationIslands () |
virtual void | solveConstraints (btContactSolverInfo &solverInfo) |
void | updateActivationState (btScalar timeStep) |
void | updateActions (btScalar timeStep) |
void | startProfiling (btScalar timeStep) |
virtual void | internalSingleStepSimulation (btScalar timeStep) |
virtual void | saveKinematicState (btScalar timeStep) |
void | serializeRigidBodies (btSerializer *serializer) |
Protected Attributes | |
btConstraintSolver * | m_constraintSolver |
btSimulationIslandManager * | m_islandManager |
btAlignedObjectArray < btTypedConstraint * > | m_constraints |
btAlignedObjectArray < btRigidBody * > | m_nonStaticRigidBodies |
btVector3 | m_gravity |
btScalar | m_localTime |
bool | m_ownsIslandManager |
bool | m_ownsConstraintSolver |
bool | m_synchronizeAllMotionStates |
btAlignedObjectArray < btActionInterface * > | m_actions |
int | m_profileTimings |
btDiscreteDynamicsWorld provides discrete rigid body simulation those classes replace the obsolete CcdPhysicsEnvironment/CcdPhysicsController
Definition at line 35 of file btDiscreteDynamicsWorld.h.
btDiscreteDynamicsWorld::btDiscreteDynamicsWorld | ( | btDispatcher * | dispatcher, |
btBroadphaseInterface * | pairCache, | ||
btConstraintSolver * | constraintSolver, | ||
btCollisionConfiguration * | collisionConfiguration | ||
) |
this btDiscreteDynamicsWorld constructor gets created objects from the user, and will not delete those
Definition at line 51 of file btDiscreteDynamicsWorld.cpp.
References btAlignedAlloc, m_constraintSolver, m_islandManager, m_ownsConstraintSolver, and m_ownsIslandManager.
btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld | ( | ) | [virtual] |
Definition at line 78 of file btDiscreteDynamicsWorld.cpp.
References btAlignedFree, m_constraintSolver, m_islandManager, m_ownsConstraintSolver, m_ownsIslandManager, btConstraintSolver::~btConstraintSolver(), and btSimulationIslandManager::~btSimulationIslandManager().
void btDiscreteDynamicsWorld::addAction | ( | btActionInterface * | action | ) | [virtual] |
Implements btDynamicsWorld.
Definition at line 495 of file btDiscreteDynamicsWorld.cpp.
References m_actions, and btAlignedObjectArray< T >::push_back().
Referenced by addCharacter(), and addVehicle().
void btDiscreteDynamicsWorld::addCharacter | ( | btActionInterface * | character | ) | [virtual] |
obsolete, use addAction instead
Reimplemented from btDynamicsWorld.
Definition at line 516 of file btDiscreteDynamicsWorld.cpp.
References addAction().
void btDiscreteDynamicsWorld::addCollisionObject | ( | btCollisionObject * | collisionObject, |
short int | collisionFilterGroup = btBroadphaseProxy::StaticFilter , |
||
short int | collisionFilterMask = btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter |
||
) | [virtual] |
Reimplemented from btCollisionWorld.
Definition at line 363 of file btDiscreteDynamicsWorld.cpp.
Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), addRigidBody(), btSoftRigidDynamicsWorld::addSoftBody(), CcdPhysicsEnvironment::enableCcdPhysicsController(), and CcdPhysicsEnvironment::updateCcdPhysicsController().
void btDiscreteDynamicsWorld::addConstraint | ( | btTypedConstraint * | constraint, |
bool | disableCollisionsBetweenLinkedBodies = false |
||
) | [virtual] |
Reimplemented from btDynamicsWorld.
Definition at line 478 of file btDiscreteDynamicsWorld.cpp.
References btRigidBody::addConstraintRef(), btTypedConstraint::getRigidBodyA(), btTypedConstraint::getRigidBodyB(), m_constraints, and btAlignedObjectArray< T >::push_back().
Referenced by CcdPhysicsEnvironment::createUniversalD6Constraint().
void btDiscreteDynamicsWorld::addRigidBody | ( | btRigidBody * | body | ) | [virtual] |
Implements btDynamicsWorld.
Definition at line 384 of file btDiscreteDynamicsWorld.cpp.
References addCollisionObject(), BT_DISABLE_WORLD_GRAVITY, btRigidBody::getCollisionShape(), btRigidBody::getFlags(), ISLAND_SLEEPING, m_gravity, m_nonStaticRigidBodies, btAlignedObjectArray< T >::push_back(), and btRigidBody::setGravity().
Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), and CcdPhysicsEnvironment::updateCcdPhysicsController().
void btDiscreteDynamicsWorld::addRigidBody | ( | btRigidBody * | body, |
short | group, | ||
short | mask | ||
) | [virtual] |
Implements btDynamicsWorld.
Definition at line 409 of file btDiscreteDynamicsWorld.cpp.
References addCollisionObject(), BT_DISABLE_WORLD_GRAVITY, btRigidBody::getCollisionShape(), btRigidBody::getFlags(), ISLAND_SLEEPING, m_gravity, m_nonStaticRigidBodies, btAlignedObjectArray< T >::push_back(), and btRigidBody::setGravity().
void btDiscreteDynamicsWorld::addVehicle | ( | btActionInterface * | vehicle | ) | [virtual] |
obsolete, use addAction instead
Reimplemented from btDynamicsWorld.
Definition at line 506 of file btDiscreteDynamicsWorld.cpp.
References addAction().
void btDiscreteDynamicsWorld::applyGravity | ( | ) | [virtual] |
apply gravity, call this once per timestep
Definition at line 168 of file btDiscreteDynamicsWorld.cpp.
References btRigidBody::applyGravity(), i, m_nonStaticRigidBodies, and btAlignedObjectArray< T >::size().
Referenced by stepSimulation().
void btDiscreteDynamicsWorld::calculateSimulationIslands | ( | ) | [protected, virtual] |
Definition at line 708 of file btDiscreteDynamicsWorld.cpp.
References BT_PROFILE, getCollisionWorld(), btCollisionWorld::getDispatcher(), btTypedConstraint::getRigidBodyA(), btTypedConstraint::getRigidBodyB(), getSimulationIslandManager(), btSimulationIslandManager::getUnionFind(), i, m_constraints, btAlignedObjectArray< T >::size(), btSimulationIslandManager::storeIslandActivationState(), btUnionFind::unite(), and btSimulationIslandManager::updateActivationState().
Referenced by btContinuousDynamicsWorld::internalSingleStepSimulation(), and internalSingleStepSimulation().
void btDiscreteDynamicsWorld::clearForces | ( | ) | [virtual] |
the forces on each rigidbody is accumulating together with gravity. clear this after each timestep.
Implements btDynamicsWorld.
Definition at line 155 of file btDiscreteDynamicsWorld.cpp.
References btRigidBody::clearForces(), i, m_nonStaticRigidBodies, and btAlignedObjectArray< T >::size().
Referenced by stepSimulation().
void btDiscreteDynamicsWorld::debugDrawConstraint | ( | btTypedConstraint * | constraint | ) |
Definition at line 909 of file btDiscreteDynamicsWorld.cpp.
References btCos(), btSin(), CONETWIST_CONSTRAINT_TYPE, D6_CONSTRAINT_TYPE, D6_SPRING_CONSTRAINT_TYPE, btIDebugDraw::DBG_DrawConstraintLimits, btIDebugDraw::DBG_DrawConstraints, btIDebugDraw::drawArc(), btIDebugDraw::drawBox(), btIDebugDraw::drawLine(), btIDebugDraw::drawSpherePatch(), btIDebugDraw::drawTransform(), btConeTwistConstraint::getAFrame(), btGeneric6DofConstraint::getAngle(), btTransform::getBasis(), btConeTwistConstraint::getBFrame(), btGeneric6DofConstraint::getCalculatedTransformA(), btSliderConstraint::getCalculatedTransformA(), btGeneric6DofConstraint::getCalculatedTransformB(), btSliderConstraint::getCalculatedTransformB(), btRigidBody::getCenterOfMassTransform(), btMatrix3x3::getColumn(), btTypedConstraint::getConstraintType(), btTypedConstraint::getDbgDrawSize(), btCollisionWorld::getDebugDrawer(), btIDebugDraw::getDebugMode(), btRigidBody::getInvMass(), btSliderConstraint::getLowerAngLimit(), btSliderConstraint::getLowerLinLimit(), btTransform::getOrigin(), btConeTwistConstraint::GetPointForAngle(), btConeTwistConstraint::getRigidBodyA(), btConeTwistConstraint::getRigidBodyB(), btGeneric6DofConstraint::getRotationalLimitMotor(), btGeneric6DofConstraint::getTranslationalLimitMotor(), btConeTwistConstraint::getTwistAngle(), btConeTwistConstraint::getTwistSpan(), btSliderConstraint::getUpperAngLimit(), btSliderConstraint::getUpperLinLimit(), btSliderConstraint::getUseLinearReferenceFrameA(), HINGE_CONSTRAINT_TYPE, i, length(), btRotationalLimitMotor::m_hiLimit, btRotationalLimitMotor::m_loLimit, btTranslationalLimitMotor::m_lowerLimit, btTranslationalLimitMotor::m_upperLimit, POINT2POINT_CONSTRAINT_TYPE, btTransform::setIdentity(), btTransform::setOrigin(), SIMD_2_PI, SIMD_PI, and SLIDER_CONSTRAINT_TYPE.
Referenced by debugDrawWorld().
void btDiscreteDynamicsWorld::debugDrawWorld | ( | ) | [virtual] |
Implements btDynamicsWorld.
Reimplemented in btSoftRigidDynamicsWorld.
Definition at line 115 of file btDiscreteDynamicsWorld.cpp.
References BT_PROFILE, btIDebugDraw::DBG_DrawAabb, btIDebugDraw::DBG_DrawConstraintLimits, btIDebugDraw::DBG_DrawConstraints, btIDebugDraw::DBG_DrawWireframe, debugDrawConstraint(), getConstraint(), btCollisionWorld::getDebugDrawer(), btIDebugDraw::getDebugMode(), getNumConstraints(), i, m_actions, btCollisionWorld::m_debugDrawer, and btAlignedObjectArray< T >::size().
btCollisionWorld* btDiscreteDynamicsWorld::getCollisionWorld | ( | ) | [inline] |
Definition at line 117 of file btDiscreteDynamicsWorld.h.
Referenced by calculateSimulationIslands(), and solveConstraints().
const btTypedConstraint * btDiscreteDynamicsWorld::getConstraint | ( | int | index | ) | const [virtual] |
Reimplemented from btDynamicsWorld.
Definition at line 1117 of file btDiscreteDynamicsWorld.cpp.
References m_constraints.
btTypedConstraint * btDiscreteDynamicsWorld::getConstraint | ( | int | index | ) | [virtual] |
Reimplemented from btDynamicsWorld.
Definition at line 1113 of file btDiscreteDynamicsWorld.cpp.
References m_constraints.
Referenced by debugDrawWorld(), and CcdPhysicsEnvironment::removeConstraint().
btConstraintSolver * btDiscreteDynamicsWorld::getConstraintSolver | ( | ) | [virtual] |
Implements btDynamicsWorld.
Definition at line 1103 of file btDiscreteDynamicsWorld.cpp.
References m_constraintSolver.
btVector3 btDiscreteDynamicsWorld::getGravity | ( | ) | const [virtual] |
Implements btDynamicsWorld.
Definition at line 358 of file btDiscreteDynamicsWorld.cpp.
References m_gravity.
Referenced by CcdPhysicsEnvironment::getGravity().
int btDiscreteDynamicsWorld::getNumConstraints | ( | ) | const [virtual] |
Reimplemented from btDynamicsWorld.
Definition at line 1109 of file btDiscreteDynamicsWorld.cpp.
References m_constraints, and btAlignedObjectArray< T >::size().
Referenced by debugDrawWorld(), CcdPhysicsEnvironment::removeConstraint(), and solveConstraints().
btSimulationIslandManager* btDiscreteDynamicsWorld::getSimulationIslandManager | ( | ) | [inline] |
Definition at line 107 of file btDiscreteDynamicsWorld.h.
References m_islandManager.
Referenced by calculateSimulationIslands().
const btSimulationIslandManager* btDiscreteDynamicsWorld::getSimulationIslandManager | ( | ) | const [inline] |
Definition at line 112 of file btDiscreteDynamicsWorld.h.
References m_islandManager.
bool btDiscreteDynamicsWorld::getSynchronizeAllMotionStates | ( | ) | const [inline] |
Definition at line 188 of file btDiscreteDynamicsWorld.h.
References m_synchronizeAllMotionStates.
virtual btDynamicsWorldType btDiscreteDynamicsWorld::getWorldType | ( | ) | const [inline, virtual] |
Implements btDynamicsWorld.
Reimplemented in btContinuousDynamicsWorld.
Definition at line 153 of file btDiscreteDynamicsWorld.h.
References BT_DISCRETE_DYNAMICS_WORLD.
void btDiscreteDynamicsWorld::integrateTransforms | ( | btScalar | timeStep | ) | [protected, virtual] |
Definition at line 828 of file btDiscreteDynamicsWorld.cpp.
References BT_PROFILE, btCollisionWorld::convexSweepTest(), btCollisionWorld::getBroadphase(), btRigidBody::getBroadphaseProxy(), btRigidBody::getCollisionShape(), btCollisionWorld::getDispatcher(), btTransform::getOrigin(), btBroadphaseInterface::getOverlappingPairCache(), gNumClampedCcdMotions, i, btCollisionShape::isConvex(), btCollisionWorld::ConvexResultCallback::m_collisionFilterGroup, m_nonStaticRigidBodies, btRigidBody::predictIntegratedTransform(), btRigidBody::proceedToTransform(), and btAlignedObjectArray< T >::size().
Referenced by btContinuousDynamicsWorld::internalSingleStepSimulation(), and internalSingleStepSimulation().
void btDiscreteDynamicsWorld::internalSingleStepSimulation | ( | btScalar | timeStep | ) | [protected, virtual] |
apply gravity, predict motion
perform collision detection
solve contact and other joint constraints
CallbackTriggers();
integrate transforms
update vehicle simulation
Reimplemented in btContinuousDynamicsWorld, and btSoftRigidDynamicsWorld.
Definition at line 299 of file btDiscreteDynamicsWorld.cpp.
References BT_PROFILE, calculateSimulationIslands(), btCollisionWorld::getDebugDrawer(), btCollisionWorld::getDispatchInfo(), btDynamicsWorld::getSolverInfo(), integrateTransforms(), btDispatcherInfo::m_debugDraw, btDynamicsWorld::m_internalPreTickCallback, btDynamicsWorld::m_internalTickCallback, btDispatcherInfo::m_stepCount, btDispatcherInfo::m_timeStep, btContactSolverInfoData::m_timeStep, btCollisionWorld::performDiscreteCollisionDetection(), predictUnconstraintMotion(), solveConstraints(), updateActions(), and updateActivationState().
Referenced by stepSimulation().
void btDiscreteDynamicsWorld::predictUnconstraintMotion | ( | btScalar | timeStep | ) | [protected, virtual] |
Reimplemented in btSoftRigidDynamicsWorld.
Definition at line 876 of file btDiscreteDynamicsWorld.cpp.
References btRigidBody::applyDamping(), BT_PROFILE, i, btRigidBody::integrateVelocities(), m_nonStaticRigidBodies, btRigidBody::predictIntegratedTransform(), and btAlignedObjectArray< T >::size().
Referenced by btContinuousDynamicsWorld::internalSingleStepSimulation(), and internalSingleStepSimulation().
void btDiscreteDynamicsWorld::removeAction | ( | btActionInterface * | action | ) | [virtual] |
Implements btDynamicsWorld.
Definition at line 500 of file btDiscreteDynamicsWorld.cpp.
References m_actions, and btAlignedObjectArray< T >::remove().
Referenced by removeCharacter(), and removeVehicle().
void btDiscreteDynamicsWorld::removeCharacter | ( | btActionInterface * | character | ) | [virtual] |
obsolete, use removeAction instead
Reimplemented from btDynamicsWorld.
Definition at line 521 of file btDiscreteDynamicsWorld.cpp.
References removeAction().
void btDiscreteDynamicsWorld::removeCollisionObject | ( | btCollisionObject * | collisionObject | ) | [virtual] |
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject
Reimplemented from btCollisionWorld.
Reimplemented in btSoftRigidDynamicsWorld.
Definition at line 368 of file btDiscreteDynamicsWorld.cpp.
References removeRigidBody(), and btRigidBody::upcast().
Referenced by removeRigidBody().
void btDiscreteDynamicsWorld::removeConstraint | ( | btTypedConstraint * | constraint | ) | [virtual] |
Reimplemented from btDynamicsWorld.
Definition at line 488 of file btDiscreteDynamicsWorld.cpp.
References btTypedConstraint::getRigidBodyA(), btTypedConstraint::getRigidBodyB(), m_constraints, btAlignedObjectArray< T >::remove(), and btRigidBody::removeConstraintRef().
Referenced by CcdPhysicsEnvironment::removeCcdPhysicsController(), and CcdPhysicsEnvironment::removeConstraint().
void btDiscreteDynamicsWorld::removeRigidBody | ( | btRigidBody * | body | ) | [virtual] |
Implements btDynamicsWorld.
Definition at line 377 of file btDiscreteDynamicsWorld.cpp.
References m_nonStaticRigidBodies, btAlignedObjectArray< T >::remove(), and removeCollisionObject().
Referenced by CcdPhysicsEnvironment::disableCcdPhysicsController(), CcdPhysicsEnvironment::removeCcdPhysicsController(), and removeCollisionObject().
void btDiscreteDynamicsWorld::removeVehicle | ( | btActionInterface * | vehicle | ) | [virtual] |
obsolete, use removeAction instead
Reimplemented from btDynamicsWorld.
Definition at line 511 of file btDiscreteDynamicsWorld.cpp.
References removeAction().
void btDiscreteDynamicsWorld::saveKinematicState | ( | btScalar | timeStep | ) | [protected, virtual] |
would like to iterate over m_nonStaticRigidBodies, but unfortunately old API allows to switch status _after_ adding kinematic objects to the world fix it for Bullet 3.x release
Definition at line 94 of file btDiscreteDynamicsWorld.cpp.
References i, ISLAND_SLEEPING, btCollisionWorld::m_collisionObjects, btRigidBody::saveKinematicState(), btAlignedObjectArray< T >::size(), and btRigidBody::upcast().
Referenced by stepSimulation().
void btDiscreteDynamicsWorld::serialize | ( | btSerializer * | serializer | ) | [virtual] |
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see Bullet/Demos/SerializeDemo)
Reimplemented from btCollisionWorld.
Reimplemented in btSoftRigidDynamicsWorld.
Definition at line 1151 of file btDiscreteDynamicsWorld.cpp.
References btSerializer::finishSerialization(), btCollisionWorld::serializeCollisionObjects(), serializeRigidBodies(), and btSerializer::startSerialization().
void btDiscreteDynamicsWorld::serializeRigidBodies | ( | btSerializer * | serializer | ) | [protected] |
Definition at line 1124 of file btDiscreteDynamicsWorld.cpp.
References btSerializer::allocate(), BT_CONSTRAINT_CODE, BT_RIGIDBODY_CODE, btTypedConstraint::calculateSerializeBufferSize(), btSerializer::finalizeChunk(), i, len(), btCollisionWorld::m_collisionObjects, m_constraints, btChunk::m_oldPtr, btTypedConstraint::serialize(), btAlignedObjectArray< T >::size(), and size().
Referenced by btSoftRigidDynamicsWorld::serialize(), and serialize().
void btDiscreteDynamicsWorld::setConstraintSolver | ( | btConstraintSolver * | solver | ) | [virtual] |
Implements btDynamicsWorld.
Definition at line 1093 of file btDiscreteDynamicsWorld.cpp.
References btAlignedFree, m_constraintSolver, and m_ownsConstraintSolver.
void btDiscreteDynamicsWorld::setGravity | ( | const btVector3 & | gravity | ) | [virtual] |
Implements btDynamicsWorld.
Definition at line 345 of file btDiscreteDynamicsWorld.cpp.
References BT_DISABLE_WORLD_GRAVITY, btRigidBody::getFlags(), i, m_gravity, m_nonStaticRigidBodies, btRigidBody::setGravity(), and btAlignedObjectArray< T >::size().
Referenced by CcdPhysicsEnvironment::setGravity().
virtual void btDiscreteDynamicsWorld::setNumTasks | ( | int | numTasks | ) | [inline, virtual] |
Definition at line 164 of file btDiscreteDynamicsWorld.h.
void btDiscreteDynamicsWorld::setSynchronizeAllMotionStates | ( | bool | synchronizeAll | ) | [inline] |
Definition at line 184 of file btDiscreteDynamicsWorld.h.
References m_synchronizeAllMotionStates.
void btDiscreteDynamicsWorld::solveConstraints | ( | btContactSolverInfo & | solverInfo | ) | [protected, virtual] |
we don't split islands, so all constraints/contact manifolds/bodies are passed into the solver regardless the island id
only call solveGroup if there is some work: avoid virtual function call, its overhead can be excessive
solve all the constraints for this island
Definition at line 554 of file btDiscreteDynamicsWorld.cpp.
References btConstraintSolver::allSolved(), BT_PROFILE, btAssert, btGetConstraintIslandId(), btSimulationIslandManager::buildAndProcessIslands(), getCollisionWorld(), btCollisionWorld::getDispatcher(), btCollisionWorld::getNumCollisionObjects(), getNumConstraints(), i, m_constraints, m_constraintSolver, btCollisionWorld::m_debugDrawer, btCollisionWorld::m_dispatcher1, m_islandManager, btContactSolverInfoData::m_minimumSolverBatchSize, btDynamicsWorld::m_solverInfo, btCollisionWorld::m_stackAlloc, btConstraintSolver::prepareSolve(), btAlignedObjectArray< T >::push_back(), btAlignedObjectArray< T >::quickSort(), btAlignedObjectArray< T >::resize(), btAlignedObjectArray< T >::size(), and startConstraint().
Referenced by btContinuousDynamicsWorld::internalSingleStepSimulation(), and internalSingleStepSimulation().
void btDiscreteDynamicsWorld::startProfiling | ( | btScalar | timeStep | ) | [protected] |
Definition at line 894 of file btDiscreteDynamicsWorld.cpp.
References CProfileManager::Reset().
Referenced by btContinuousDynamicsWorld::internalSingleStepSimulation(), and stepSimulation().
int btDiscreteDynamicsWorld::stepSimulation | ( | btScalar | timeStep, |
int | maxSubSteps = 1 , |
||
btScalar | fixedTimeStep = btScalar(1.)/btScalar(60.) |
||
) | [virtual] |
if maxSubSteps > 0, it will interpolate motion between fixedTimeStep's
Implements btDynamicsWorld.
Definition at line 228 of file btDiscreteDynamicsWorld.cpp.
References applyGravity(), BT_PROFILE, btFuzzyZero(), clearForces(), btIDebugDraw::DBG_NoDeactivation, gDisableDeactivation, btCollisionWorld::getDebugDrawer(), btIDebugDraw::getDebugMode(), i, CProfileManager::Increment_Frame_Counter(), internalSingleStepSimulation(), m_localTime, saveKinematicState(), startProfiling(), and synchronizeMotionStates().
Referenced by CcdPhysicsEnvironment::proceedDeltaTime().
void btDiscreteDynamicsWorld::synchronizeMotionStates | ( | ) | [virtual] |
Implements btDynamicsWorld.
Definition at line 202 of file btDiscreteDynamicsWorld.cpp.
References BT_PROFILE, i, btCollisionWorld::m_collisionObjects, m_nonStaticRigidBodies, m_synchronizeAllMotionStates, btAlignedObjectArray< T >::size(), synchronizeSingleMotionState(), and btRigidBody::upcast().
Referenced by stepSimulation().
void btDiscreteDynamicsWorld::synchronizeSingleMotionState | ( | btRigidBody * | body | ) |
this can be useful to synchronize a single rigid body -> graphics object
Definition at line 182 of file btDiscreteDynamicsWorld.cpp.
References btAssert, btRigidBody::getMotionState(), btTransformUtil::integrateTransform(), m_localTime, and btMotionState::setWorldTransform().
Referenced by synchronizeMotionStates().
void btDiscreteDynamicsWorld::updateActions | ( | btScalar | timeStep | ) | [protected] |
Definition at line 431 of file btDiscreteDynamicsWorld.cpp.
References BT_PROFILE, i, m_actions, and btAlignedObjectArray< T >::size().
Referenced by btContinuousDynamicsWorld::internalSingleStepSimulation(), internalSingleStepSimulation(), and updateVehicles().
void btDiscreteDynamicsWorld::updateActivationState | ( | btScalar | timeStep | ) | [protected] |
Definition at line 442 of file btDiscreteDynamicsWorld.cpp.
References ACTIVE_TAG, BT_PROFILE, DISABLE_DEACTIVATION, i, ISLAND_SLEEPING, m_nonStaticRigidBodies, btRigidBody::setAngularVelocity(), btRigidBody::setLinearVelocity(), btAlignedObjectArray< T >::size(), btRigidBody::updateDeactivation(), WANTS_DEACTIVATION, and btRigidBody::wantsSleeping().
Referenced by btContinuousDynamicsWorld::internalSingleStepSimulation(), and internalSingleStepSimulation().
virtual void btDiscreteDynamicsWorld::updateVehicles | ( | btScalar | timeStep | ) | [inline, virtual] |
obsolete, use updateActions instead
Definition at line 170 of file btDiscreteDynamicsWorld.h.
References updateActions().
Definition at line 57 of file btDiscreteDynamicsWorld.h.
Referenced by addAction(), debugDrawWorld(), removeAction(), and updateActions().
Definition at line 43 of file btDiscreteDynamicsWorld.h.
Referenced by addConstraint(), calculateSimulationIslands(), getConstraint(), getNumConstraints(), removeConstraint(), serializeRigidBodies(), and solveConstraints().
Definition at line 39 of file btDiscreteDynamicsWorld.h.
Referenced by btDiscreteDynamicsWorld(), getConstraintSolver(), setConstraintSolver(), solveConstraints(), and ~btDiscreteDynamicsWorld().
btVector3 btDiscreteDynamicsWorld::m_gravity [protected] |
Definition at line 47 of file btDiscreteDynamicsWorld.h.
Referenced by addRigidBody(), getGravity(), and setGravity().
Definition at line 41 of file btDiscreteDynamicsWorld.h.
Referenced by btDiscreteDynamicsWorld(), getSimulationIslandManager(), solveConstraints(), and ~btDiscreteDynamicsWorld().
btScalar btDiscreteDynamicsWorld::m_localTime [protected] |
Definition at line 50 of file btDiscreteDynamicsWorld.h.
Referenced by stepSimulation(), and synchronizeSingleMotionState().
Definition at line 45 of file btDiscreteDynamicsWorld.h.
Referenced by addRigidBody(), applyGravity(), clearForces(), integrateTransforms(), predictUnconstraintMotion(), removeRigidBody(), setGravity(), synchronizeMotionStates(), and updateActivationState().
bool btDiscreteDynamicsWorld::m_ownsConstraintSolver [protected] |
Definition at line 54 of file btDiscreteDynamicsWorld.h.
Referenced by btDiscreteDynamicsWorld(), setConstraintSolver(), and ~btDiscreteDynamicsWorld().
bool btDiscreteDynamicsWorld::m_ownsIslandManager [protected] |
Definition at line 53 of file btDiscreteDynamicsWorld.h.
Referenced by btDiscreteDynamicsWorld(), and ~btDiscreteDynamicsWorld().
int btDiscreteDynamicsWorld::m_profileTimings [protected] |
Definition at line 59 of file btDiscreteDynamicsWorld.h.
bool btDiscreteDynamicsWorld::m_synchronizeAllMotionStates [protected] |
Definition at line 55 of file btDiscreteDynamicsWorld.h.
Referenced by getSynchronizeAllMotionStates(), setSynchronizeAllMotionStates(), and synchronizeMotionStates().