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

#include <btSoftRigidDynamicsWorld.h>

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

Public Member Functions

 btSoftRigidDynamicsWorld (btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration, btSoftBodySolver *softBodySolver=0)
 
virtual ~btSoftRigidDynamicsWorld ()
 
virtual void debugDrawWorld ()
 
void addSoftBody (btSoftBody *body, short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, short int collisionFilterMask=btBroadphaseProxy::AllFilter)
 
void removeSoftBody (btSoftBody *body)
 
virtual void removeCollisionObject (btCollisionObject *collisionObject)
 removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btDiscreteDynamicsWorld::removeCollisionObject More...
 
int getDrawFlags () const
 
void setDrawFlags (int f)
 
btSoftBodyWorldInfogetWorldInfo ()
 
const btSoftBodyWorldInfogetWorldInfo () const
 
virtual btDynamicsWorldType getWorldType () const
 
btSoftBodyArraygetSoftBodyArray ()
 
const btSoftBodyArraygetSoftBodyArray () 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...
 
virtual void serialize (btSerializer *serializer)
 Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see Bullet/Demos/SerializeDemo) More...
 
- Public Member Functions inherited from btDiscreteDynamicsWorld
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btDiscreteDynamicsWorld (btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration)
 this btDiscreteDynamicsWorld constructor gets created objects from the user, and will not delete those More...
 
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 More...
 
virtual void synchronizeMotionStates ()
 
void synchronizeSingleMotionState (btRigidBody *body)
 this can be useful to synchronize a single rigid body -> graphics object More...
 
virtual void addConstraint (btTypedConstraint *constraint, bool disableCollisionsBetweenLinkedBodies=false)
 
virtual void removeConstraint (btTypedConstraint *constraint)
 
virtual void addAction (btActionInterface *)
 
virtual void removeAction (btActionInterface *)
 
btSimulationIslandManagergetSimulationIslandManager ()
 
const btSimulationIslandManagergetSimulationIslandManager () const
 
btCollisionWorldgetCollisionWorld ()
 
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)
 
void debugDrawConstraint (btTypedConstraint *constraint)
 
virtual void setConstraintSolver (btConstraintSolver *solver)
 
virtual btConstraintSolvergetConstraintSolver ()
 
virtual int getNumConstraints () const
 
virtual btTypedConstraintgetConstraint (int index)
 
virtual const btTypedConstraintgetConstraint (int index) const
 
virtual void clearForces ()
 the forces on each rigidbody is accumulating together with gravity. clear this after each timestep. More...
 
virtual void applyGravity ()
 apply gravity, call this once per timestep More...
 
virtual void setNumTasks (int numTasks)
 
virtual void updateVehicles (btScalar timeStep)
 obsolete, use updateActions instead More...
 
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...
 
void setSynchronizeAllMotionStates (bool synchronizeAll)
 
bool getSynchronizeAllMotionStates () const
 
void setApplySpeculativeContactRestitution (bool enable)
 
bool getApplySpeculativeContactRestitution () const
 
- Public Member Functions inherited from btDynamicsWorld
 btDynamicsWorld (btDispatcher *dispatcher, btBroadphaseInterface *broadphase, btCollisionConfiguration *collisionConfiguration)
 
virtual ~btDynamicsWorld ()
 
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 ()
 
- 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 updateAabbs ()
 
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
 
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...
 
btCollisionObjectArraygetCollisionObjectArray ()
 
const btCollisionObjectArraygetCollisionObjectArray () const
 
virtual void performDiscreteCollisionDetection ()
 
btDispatcherInfogetDispatchInfo ()
 
const btDispatcherInfogetDispatchInfo () const
 
bool getForceUpdateAllAabbs () const
 
void setForceUpdateAllAabbs (bool forceUpdateAllAabbs)
 

Static Public Member Functions

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...
 

Protected Member Functions

virtual void predictUnconstraintMotion (btScalar timeStep)
 
virtual void internalSingleStepSimulation (btScalar timeStep)
 
void solveSoftBodiesConstraints (btScalar timeStep)
 
void serializeSoftBodies (btSerializer *serializer)
 
- Protected Member Functions inherited from btDiscreteDynamicsWorld
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)
 
void createPredictiveContacts (btScalar timeStep)
 
virtual void saveKinematicState (btScalar timeStep)
 
void serializeRigidBodies (btSerializer *serializer)
 
void serializeDynamicsWorldInfo (btSerializer *serializer)
 

Private Attributes

btSoftBodyArray m_softBodies
 
int m_drawFlags
 
bool m_drawNodeTree
 
bool m_drawFaceTree
 
bool m_drawClusterTree
 
btSoftBodyWorldInfo m_sbi
 
btSoftBodySolverm_softBodySolver
 Solver classes that encapsulate multiple soft bodies for solving. More...
 
bool m_ownsSolver
 

Additional Inherited Members

- Protected Attributes inherited from btDiscreteDynamicsWorld
btAlignedObjectArray
< btTypedConstraint * > 
m_sortedConstraints
 
InplaceSolverIslandCallbackm_solverIslandCallback
 
btConstraintSolverm_constraintSolver
 
btSimulationIslandManagerm_islandManager
 
btAlignedObjectArray
< btTypedConstraint * > 
m_constraints
 
btAlignedObjectArray
< btRigidBody * > 
m_nonStaticRigidBodies
 
btVector3 m_gravity
 
btScalar m_localTime
 
bool m_ownsIslandManager
 
bool m_ownsConstraintSolver
 
bool m_synchronizeAllMotionStates
 
bool m_applySpeculativeContactRestitution
 
btAlignedObjectArray
< btActionInterface * > 
m_actions
 
int m_profileTimings
 
btAlignedObjectArray
< btPersistentManifold * > 
m_predictiveManifolds
 

Detailed Description

Definition at line 26 of file btSoftRigidDynamicsWorld.h.

Constructor & Destructor Documentation

btSoftRigidDynamicsWorld::btSoftRigidDynamicsWorld ( btDispatcher dispatcher,
btBroadphaseInterface pairCache,
btConstraintSolver constraintSolver,
btCollisionConfiguration collisionConfiguration,
btSoftBodySolver softBodySolver = 0 
)

Definition at line 28 of file btSoftRigidDynamicsWorld.cpp.

btSoftRigidDynamicsWorld::~btSoftRigidDynamicsWorld ( )
virtual

Definition at line 65 of file btSoftRigidDynamicsWorld.cpp.

Member Function Documentation

void btSoftRigidDynamicsWorld::addSoftBody ( btSoftBody body,
short int  collisionFilterGroup = btBroadphaseProxy::DefaultFilter,
short int  collisionFilterMask = btBroadphaseProxy::AllFilter 
)

Definition at line 128 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::debugDrawWorld ( )
virtual

Reimplemented from btDiscreteDynamicsWorld.

Definition at line 158 of file btSoftRigidDynamicsWorld.cpp.

int btSoftRigidDynamicsWorld::getDrawFlags ( ) const
inline

Definition at line 64 of file btSoftRigidDynamicsWorld.h.

btSoftBodyArray& btSoftRigidDynamicsWorld::getSoftBodyArray ( )
inline

Definition at line 81 of file btSoftRigidDynamicsWorld.h.

const btSoftBodyArray& btSoftRigidDynamicsWorld::getSoftBodyArray ( ) const
inline

Definition at line 86 of file btSoftRigidDynamicsWorld.h.

btSoftBodyWorldInfo& btSoftRigidDynamicsWorld::getWorldInfo ( )
inline

Definition at line 67 of file btSoftRigidDynamicsWorld.h.

const btSoftBodyWorldInfo& btSoftRigidDynamicsWorld::getWorldInfo ( ) const
inline

Definition at line 71 of file btSoftRigidDynamicsWorld.h.

virtual btDynamicsWorldType btSoftRigidDynamicsWorld::getWorldType ( ) const
inlinevirtual

Reimplemented from btDiscreteDynamicsWorld.

Definition at line 76 of file btSoftRigidDynamicsWorld.h.

void btSoftRigidDynamicsWorld::internalSingleStepSimulation ( btScalar  timeStep)
protectedvirtual

solve soft bodies constraints

update soft bodies

Reimplemented from btDiscreteDynamicsWorld.

Definition at line 83 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::predictUnconstraintMotion ( btScalar  timeStep)
protectedvirtual

Reimplemented from btDiscreteDynamicsWorld.

Definition at line 74 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::rayTest ( const btVector3 rayFromWorld,
const btVector3 rayToWorld,
RayResultCallback resultCallback 
) const
virtual

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.

use the broadphase to accelerate the search for objects, based on their aabb and for each object with ray-aabb overlap, perform an exact ray test

use the broadphase to accelerate the search for objects, based on their aabb and for each object with ray-aabb overlap, perform an exact ray test

Reimplemented from btCollisionWorld.

Definition at line 264 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::rayTestSingle ( const btTransform rayFromTrans,
const btTransform rayToTrans,
btCollisionObject collisionObject,
const btCollisionShape collisionShape,
const btTransform colObjWorldTransform,
RayResultCallback resultCallback 
)
static

rayTestSingle performs a raycast call and calls the resultCallback.

It is used internally by rayTest. In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape. This allows more customization.

Definition at line 283 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::removeCollisionObject ( btCollisionObject collisionObject)
virtual

removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btDiscreteDynamicsWorld::removeCollisionObject

Reimplemented from btDiscreteDynamicsWorld.

Definition at line 149 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::removeSoftBody ( btSoftBody body)

Definition at line 142 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::serialize ( btSerializer serializer)
virtual

Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see Bullet/Demos/SerializeDemo)

Reimplemented from btDiscreteDynamicsWorld.

Definition at line 351 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::serializeSoftBodies ( btSerializer serializer)
protected

Definition at line 333 of file btSoftRigidDynamicsWorld.cpp.

void btSoftRigidDynamicsWorld::setDrawFlags ( int  f)
inline

Definition at line 65 of file btSoftRigidDynamicsWorld.h.

void btSoftRigidDynamicsWorld::solveSoftBodiesConstraints ( btScalar  timeStep)
protected

Definition at line 114 of file btSoftRigidDynamicsWorld.cpp.

Member Data Documentation

bool btSoftRigidDynamicsWorld::m_drawClusterTree
private

Definition at line 33 of file btSoftRigidDynamicsWorld.h.

bool btSoftRigidDynamicsWorld::m_drawFaceTree
private

Definition at line 32 of file btSoftRigidDynamicsWorld.h.

int btSoftRigidDynamicsWorld::m_drawFlags
private

Definition at line 30 of file btSoftRigidDynamicsWorld.h.

bool btSoftRigidDynamicsWorld::m_drawNodeTree
private

Definition at line 31 of file btSoftRigidDynamicsWorld.h.

bool btSoftRigidDynamicsWorld::m_ownsSolver
private

Definition at line 37 of file btSoftRigidDynamicsWorld.h.

btSoftBodyWorldInfo btSoftRigidDynamicsWorld::m_sbi
private

Definition at line 34 of file btSoftRigidDynamicsWorld.h.

btSoftBodyArray btSoftRigidDynamicsWorld::m_softBodies
private

Definition at line 29 of file btSoftRigidDynamicsWorld.h.

btSoftBodySolver* btSoftRigidDynamicsWorld::m_softBodySolver
private

Solver classes that encapsulate multiple soft bodies for solving.

Definition at line 36 of file btSoftRigidDynamicsWorld.h.


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