Bullet Collision Detection & Physics Library: btSimpleDynamicsWorld Class Reference

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

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:
[legend]
Collaboration diagram for btSimpleDynamicsWorld:
[legend]

## Public Member Functions
| btSimpleDynamicsWorld (btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration)
| this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver
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
virtual void | setGravity (const btVector3 &gravity)
virtual btVector3 | getGravity () const
virtual void | addRigidBody (btRigidBody *body)
virtual void | addRigidBody (btRigidBody *body, int group, int 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
virtual void | updateAabbs ()
virtual void | synchronizeMotionStates ()
virtual void | setConstraintSolver (btConstraintSolver *solver)
virtual btConstraintSolver * | getConstraintSolver ()
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 btTypedConstraint * | getConstraint (int index)
virtual const btTypedConstraint * | getConstraint (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.
void | setWorldUserInfo (void *worldUserInfo)
void * | getWorldUserInfo () const
btContactSolverInfo & | getSolverInfo ()
const btContactSolverInfo & | getSolverInfo () const
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
Public Member Functions inherited from btCollisionWorld
| btCollisionWorld (btDispatcher *dispatcher, btBroadphaseInterface *broadphasePairCache, btCollisionConfiguration *collisionConfiguration)
| for debug drawing
virtual | ~btCollisionWorld ()
void | setBroadphase (btBroadphaseInterface *pairCache)
const btBroadphaseInterface * | getBroadphase () const
btBroadphaseInterface * | getBroadphase ()
btOverlappingPairCache * | getPairCache ()
btDispatcher * | getDispatcher ()
const btDispatcher * | getDispatcher () 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
virtual void | setDebugDrawer (btIDebugDraw *debugDrawer)
virtual btIDebugDraw * | getDebugDrawer ()
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.
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.
void | contactTest (btCollisionObject *colObj, ContactResultCallback &resultCallback)
| contactTest performs a discrete collision test between colObj against all objects in the btCollisionWorld, and calls the resultCallback.
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.
virtual void | addCollisionObject (btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
virtual void | refreshBroadphaseProxy (btCollisionObject *collisionObject)
btCollisionObjectArray & | getCollisionObjectArray ()
const btCollisionObjectArray & | getCollisionObjectArray () const
virtual void | performDiscreteCollisionDetection ()
btDispatcherInfo & | getDispatchInfo ()
const btDispatcherInfo & | getDispatchInfo () 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)

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

## Protected Attributes
btConstraintSolver * | m_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
btDispatcher * | m_dispatcher1
btDispatcherInfo | m_dispatchInfo
btBroadphaseInterface * | m_broadphasePairCache
btIDebugDraw * | m_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)

## 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.
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.
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::btSimpleDynamicsWorld | ( | btDispatcher * | dispatcher,
|  | btBroadphaseInterface * | pairCache,
|  | btConstraintSolver * | constraintSolver,
|  | btCollisionConfiguration * | collisionConfiguration )

this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver

Definition at line 35 of file btSimpleDynamicsWorld.cpp.

## ◆ ~btSimpleDynamicsWorld()

btSimpleDynamicsWorld::~btSimpleDynamicsWorld | ( |  | ) |
| virtual

Definition at line 43 of file btSimpleDynamicsWorld.cpp.

## Member Function Documentation

## ◆ addAction()

void btSimpleDynamicsWorld::addAction | ( | btActionInterface * | action | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 162 of file btSimpleDynamicsWorld.cpp.

## ◆ addRigidBody() [1/2]

void btSimpleDynamicsWorld::addRigidBody | ( | btRigidBody * | body | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 138 of file btSimpleDynamicsWorld.cpp.

## ◆ addRigidBody() [2/2]

void btSimpleDynamicsWorld::addRigidBody | ( | btRigidBody * | body,
|  | int | group,
|  | int | mask )
| virtual

Implements btDynamicsWorld.

Definition at line 148 of file btSimpleDynamicsWorld.cpp.

## ◆ clearForces()

void btSimpleDynamicsWorld::clearForces | ( |  | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 90 of file btSimpleDynamicsWorld.cpp.

## ◆ debugDrawWorld()

void btSimpleDynamicsWorld::debugDrawWorld | ( |  | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 158 of file btSimpleDynamicsWorld.cpp.

## ◆ getConstraintSolver()

btConstraintSolver * btSimpleDynamicsWorld::getConstraintSolver | ( |  | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 257 of file btSimpleDynamicsWorld.cpp.

## ◆ getGravity()

btVector3 btSimpleDynamicsWorld::getGravity | ( |  | ) | const
| virtual

Implements btDynamicsWorld.

Definition at line 119 of file btSimpleDynamicsWorld.cpp.

## ◆ getWorldType()

virtual btDynamicsWorldType btSimpleDynamicsWorld::getWorldType | ( |  | ) | const
| inlinevirtual

Implements btDynamicsWorld.

Definition at line 76 of file btSimpleDynamicsWorld.h.

## ◆ integrateTransforms()

void btSimpleDynamicsWorld::integrateTransforms | ( | btScalar | timeStep | ) |
| protected

Definition at line 190 of file btSimpleDynamicsWorld.cpp.

## ◆ predictUnconstraintMotion()

void btSimpleDynamicsWorld::predictUnconstraintMotion | ( | btScalar | timeStep | ) |
| protected

Definition at line 208 of file btSimpleDynamicsWorld.cpp.

## ◆ removeAction()

void btSimpleDynamicsWorld::removeAction | ( | btActionInterface * | action | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 166 of file btSimpleDynamicsWorld.cpp.

## ◆ removeCollisionObject()

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 129 of file btSimpleDynamicsWorld.cpp.

## ◆ removeRigidBody()

void btSimpleDynamicsWorld::removeRigidBody | ( | btRigidBody * | body | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 124 of file btSimpleDynamicsWorld.cpp.

## ◆ setConstraintSolver()

void btSimpleDynamicsWorld::setConstraintSolver | ( | btConstraintSolver * | solver | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 247 of file btSimpleDynamicsWorld.cpp.

## ◆ setGravity()

void btSimpleDynamicsWorld::setGravity | ( | const btVector3 & | gravity | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 105 of file btSimpleDynamicsWorld.cpp.

## ◆ stepSimulation()

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 49 of file btSimpleDynamicsWorld.cpp.

## ◆ synchronizeMotionStates()

void btSimpleDynamicsWorld::synchronizeMotionStates | ( |  | ) |
| virtual

Implements btDynamicsWorld.

Definition at line 230 of file btSimpleDynamicsWorld.cpp.

## ◆ updateAabbs()

void btSimpleDynamicsWorld::updateAabbs | ( |  | ) |
| virtual

Reimplemented from btCollisionWorld.

Definition at line 170 of file btSimpleDynamicsWorld.cpp.

## Member Data Documentation

## ◆ m_constraintSolver

btConstraintSolver* btSimpleDynamicsWorld::m_constraintSolver
| protected

Definition at line 30 of file btSimpleDynamicsWorld.h.

## ◆ m_gravity

btVector3 btSimpleDynamicsWorld::m_gravity
| protected

Definition at line 38 of file btSimpleDynamicsWorld.h.

## ◆ m_ownsConstraintSolver

bool btSimpleDynamicsWorld::m_ownsConstraintSolver
| protected

Definition at line 32 of file btSimpleDynamicsWorld.h.

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

- btSimpleDynamicsWorld.h
- btSimpleDynamicsWorld.cpp