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

The btSimpleDynamicsWorld serves as unit-test and to verify more complicated and optimized dynamics worlds. More...

#include <btSimpleDynamicsWorld.h>

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

Public Member Functions

 btSimpleDynamicsWorld (btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration)
 this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver More...
 
virtual ~btSimpleDynamicsWorld ()
 
virtual int stepSimulation (btScalar timeStep, int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.))
 maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld, use btDiscreteDynamicsWorld instead More...
 
virtual void setGravity (const btVector3 &gravity)
 
virtual btVector3 getGravity () const
 
virtual void addRigidBody (btRigidBody *body)
 
virtual void addRigidBody (btRigidBody *body, short group, short mask)
 
virtual void removeRigidBody (btRigidBody *body)
 
virtual void debugDrawWorld ()
 
virtual void addAction (btActionInterface *action)
 
virtual void removeAction (btActionInterface *action)
 
virtual void removeCollisionObject (btCollisionObject *collisionObject)
 removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject More...
 
virtual void updateAabbs ()
 
virtual void synchronizeMotionStates ()
 
virtual void setConstraintSolver (btConstraintSolver *solver)
 
virtual btConstraintSolvergetConstraintSolver ()
 
virtual btDynamicsWorldType getWorldType () const
 
virtual void clearForces ()
 
- Public Member Functions inherited from btDynamicsWorld
 btDynamicsWorld (btDispatcher *dispatcher, btBroadphaseInterface *broadphase, btCollisionConfiguration *collisionConfiguration)
 
virtual ~btDynamicsWorld ()
 
virtual void addConstraint (btTypedConstraint *constraint, bool disableCollisionsBetweenLinkedBodies=false)
 
virtual void removeConstraint (btTypedConstraint *constraint)
 
virtual int getNumConstraints () const
 
virtual btTypedConstraintgetConstraint (int index)
 
virtual const btTypedConstraintgetConstraint (int index) const
 
void setInternalTickCallback (btInternalTickCallback cb, void *worldUserInfo=0, bool isPreTick=false)
 Set the callback for when an internal tick (simulation substep) happens, optional user info. More...
 
void setWorldUserInfo (void *worldUserInfo)
 
void * getWorldUserInfo () const
 
btContactSolverInfogetSolverInfo ()
 
virtual void addVehicle (btActionInterface *vehicle)
 obsolete, use addAction instead. More...
 
virtual void removeVehicle (btActionInterface *vehicle)
 obsolete, use removeAction instead More...
 
virtual void addCharacter (btActionInterface *character)
 obsolete, use addAction instead. More...
 
virtual void removeCharacter (btActionInterface *character)
 obsolete, use removeAction instead More...
 
- Public Member Functions inherited from btCollisionWorld
 btCollisionWorld (btDispatcher *dispatcher, btBroadphaseInterface *broadphasePairCache, btCollisionConfiguration *collisionConfiguration)
 for debug drawing More...
 
virtual ~btCollisionWorld ()
 
void setBroadphase (btBroadphaseInterface *pairCache)
 
const btBroadphaseInterfacegetBroadphase () const
 
btBroadphaseInterfacegetBroadphase ()
 
btOverlappingPairCachegetPairCache ()
 
btDispatchergetDispatcher ()
 
const btDispatchergetDispatcher () const
 
void updateSingleAabb (btCollisionObject *colObj)
 
virtual void computeOverlappingPairs ()
 the computeOverlappingPairs is usually already called by performDiscreteCollisionDetection (or stepSimulation) it can be useful to use if you perform ray tests without collision detection/simulation More...
 
virtual void setDebugDrawer (btIDebugDraw *debugDrawer)
 
virtual btIDebugDrawgetDebugDrawer ()
 
virtual void debugDrawObject (const btTransform &worldTransform, const btCollisionShape *shape, const btVector3 &color)
 
int getNumCollisionObjects () const
 
virtual void rayTest (const btVector3 &rayFromWorld, const btVector3 &rayToWorld, RayResultCallback &resultCallback) const
 rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback. More...
 
void convexSweepTest (const btConvexShape *castShape, const btTransform &from, const btTransform &to, ConvexResultCallback &resultCallback, btScalar allowedCcdPenetration=btScalar(0.)) const
 convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback. More...
 
void contactTest (btCollisionObject *colObj, ContactResultCallback &resultCallback)
 contactTest performs a discrete collision test between colObj against all objects in the btCollisionWorld, and calls the resultCallback. More...
 
void contactPairTest (btCollisionObject *colObjA, btCollisionObject *colObjB, ContactResultCallback &resultCallback)
 contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected. More...
 
virtual void addCollisionObject (btCollisionObject *collisionObject, short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, short int collisionFilterMask=btBroadphaseProxy::AllFilter)
 
btCollisionObjectArraygetCollisionObjectArray ()
 
const btCollisionObjectArraygetCollisionObjectArray () const
 
virtual void performDiscreteCollisionDetection ()
 
btDispatcherInfogetDispatchInfo ()
 
const btDispatcherInfogetDispatchInfo () const
 
bool getForceUpdateAllAabbs () const
 
void setForceUpdateAllAabbs (bool forceUpdateAllAabbs)
 
virtual void serialize (btSerializer *serializer)
 Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bullet/Demos/SerializeDemo) More...
 

Protected Member Functions

void predictUnconstraintMotion (btScalar timeStep)
 
void integrateTransforms (btScalar timeStep)
 
- Protected Member Functions inherited from btCollisionWorld
void serializeCollisionObjects (btSerializer *serializer)
 

Protected Attributes

btConstraintSolverm_constraintSolver
 
bool m_ownsConstraintSolver
 
btVector3 m_gravity
 
- Protected Attributes inherited from btDynamicsWorld
btInternalTickCallback m_internalTickCallback
 
btInternalTickCallback m_internalPreTickCallback
 
void * m_worldUserInfo
 
btContactSolverInfo m_solverInfo
 
- Protected Attributes inherited from btCollisionWorld
btAlignedObjectArray
< btCollisionObject * > 
m_collisionObjects
 
btDispatcherm_dispatcher1
 
btDispatcherInfo m_dispatchInfo
 
btBroadphaseInterfacem_broadphasePairCache
 
btIDebugDrawm_debugDrawer
 
bool m_forceUpdateAllAabbs
 m_forceUpdateAllAabbs can be set to false as an optimization to only update active object AABBs it is true by default, because it is error-prone (setting the position of static objects wouldn't update their AABB) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from btCollisionWorld
static void rayTestSingle (const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback)
 rayTestSingle performs a raycast call and calls the resultCallback. More...
 
static void rayTestSingleInternal (const btTransform &rayFromTrans, const btTransform &rayToTrans, const btCollisionObjectWrapper *collisionObjectWrap, RayResultCallback &resultCallback)
 
static void objectQuerySingle (const btConvexShape *castShape, const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, ConvexResultCallback &resultCallback, btScalar allowedPenetration)
 objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest. More...
 
static void objectQuerySingleInternal (const btConvexShape *castShape, const btTransform &convexFromTrans, const btTransform &convexToTrans, const btCollisionObjectWrapper *colObjWrap, ConvexResultCallback &resultCallback, btScalar allowedPenetration)
 

Detailed Description

The btSimpleDynamicsWorld serves as unit-test and to verify more complicated and optimized dynamics worlds.

Please use btDiscreteDynamicsWorld instead

Definition at line 27 of file btSimpleDynamicsWorld.h.

Constructor & Destructor Documentation

btSimpleDynamicsWorld::btSimpleDynamicsWorld ( btDispatcher dispatcher,
btBroadphaseInterface pairCache,
btConstraintSolver constraintSolver,
btCollisionConfiguration collisionConfiguration 
)

this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver

Definition at line 39 of file btSimpleDynamicsWorld.cpp.

btSimpleDynamicsWorld::~btSimpleDynamicsWorld ( )
virtual

Definition at line 49 of file btSimpleDynamicsWorld.cpp.

Member Function Documentation

void btSimpleDynamicsWorld::addAction ( btActionInterface action)
virtual

Implements btDynamicsWorld.

Definition at line 174 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::addRigidBody ( btRigidBody body)
virtual

Implements btDynamicsWorld.

Definition at line 148 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::addRigidBody ( btRigidBody body,
short  group,
short  mask 
)
virtual

Implements btDynamicsWorld.

Definition at line 158 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::clearForces ( )
virtual

Implements btDynamicsWorld.

Definition at line 98 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::debugDrawWorld ( )
virtual

Implements btDynamicsWorld.

Definition at line 169 of file btSimpleDynamicsWorld.cpp.

btConstraintSolver * btSimpleDynamicsWorld::getConstraintSolver ( )
virtual

Implements btDynamicsWorld.

Definition at line 277 of file btSimpleDynamicsWorld.cpp.

btVector3 btSimpleDynamicsWorld::getGravity ( ) const
virtual

Implements btDynamicsWorld.

Definition at line 128 of file btSimpleDynamicsWorld.cpp.

virtual btDynamicsWorldType btSimpleDynamicsWorld::getWorldType ( ) const
inlinevirtual

Implements btDynamicsWorld.

Definition at line 80 of file btSimpleDynamicsWorld.h.

void btSimpleDynamicsWorld::integrateTransforms ( btScalar  timeStep)
protected

Definition at line 205 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::predictUnconstraintMotion ( btScalar  timeStep)
protected

Definition at line 225 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::removeAction ( btActionInterface action)
virtual

Implements btDynamicsWorld.

Definition at line 179 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::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.

Definition at line 138 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::removeRigidBody ( btRigidBody body)
virtual

Implements btDynamicsWorld.

Definition at line 133 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::setConstraintSolver ( btConstraintSolver solver)
virtual

Implements btDynamicsWorld.

Definition at line 267 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::setGravity ( const btVector3 gravity)
virtual

Implements btDynamicsWorld.

Definition at line 114 of file btSimpleDynamicsWorld.cpp.

int btSimpleDynamicsWorld::stepSimulation ( btScalar  timeStep,
int  maxSubSteps = 1,
btScalar  fixedTimeStep = btScalar(1.)/btScalar(60.) 
)
virtual

maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld, use btDiscreteDynamicsWorld instead

apply gravity, predict motion

perform collision detection

solve contact constraints

integrate transforms

Implements btDynamicsWorld.

Definition at line 55 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::synchronizeMotionStates ( )
virtual

Implements btDynamicsWorld.

Definition at line 248 of file btSimpleDynamicsWorld.cpp.

void btSimpleDynamicsWorld::updateAabbs ( )
virtual

Reimplemented from btCollisionWorld.

Definition at line 185 of file btSimpleDynamicsWorld.cpp.

Member Data Documentation

btConstraintSolver* btSimpleDynamicsWorld::m_constraintSolver
protected

Definition at line 31 of file btSimpleDynamicsWorld.h.

btVector3 btSimpleDynamicsWorld::m_gravity
protected

Definition at line 39 of file btSimpleDynamicsWorld.h.

bool btSimpleDynamicsWorld::m_ownsConstraintSolver
protected

Definition at line 33 of file btSimpleDynamicsWorld.h.


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