com.bulletphysics.dynamics
Class DynamicsWorld

java.lang.Object
  extended by com.bulletphysics.collision.dispatch.CollisionWorld
      extended by com.bulletphysics.dynamics.DynamicsWorld
Direct Known Subclasses:
DiscreteDynamicsWorld, SimpleDynamicsWorld

public abstract class DynamicsWorld
extends CollisionWorld

DynamicsWorld is the interface class for several dynamics implementation, basic, discrete, parallel, and continuous etc.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.bulletphysics.collision.dispatch.CollisionWorld
CollisionWorld.ClosestConvexResultCallback, CollisionWorld.ClosestRayResultCallback, CollisionWorld.ConvexResultCallback, CollisionWorld.LocalConvexResult, CollisionWorld.LocalRayResult, CollisionWorld.LocalShapeInfo, CollisionWorld.RayResultCallback
 
Constructor Summary
DynamicsWorld(Dispatcher dispatcher, BroadphaseInterface broadphasePairCache, CollisionConfiguration collisionConfiguration)
           
 
Method Summary
 void addAction(ActionInterface action)
           
 void addConstraint(TypedConstraint constraint)
           
 void addConstraint(TypedConstraint constraint, boolean disableCollisionsBetweenLinkedBodies)
           
abstract  void addRigidBody(RigidBody body)
           
 void addVehicle(RaycastVehicle vehicle)
           
abstract  void clearForces()
           
abstract  void debugDrawWorld()
           
 ActionInterface getAction(int index)
           
 TypedConstraint getConstraint(int index)
           
abstract  ConstraintSolver getConstraintSolver()
           
abstract  Vector3f getGravity(Vector3f out)
           
 int getNumActions()
           
 int getNumConstraints()
           
 ContactSolverInfo getSolverInfo()
           
abstract  DynamicsWorldType getWorldType()
           
 Object getWorldUserInfo()
           
 void removeAction(ActionInterface action)
           
 void removeConstraint(TypedConstraint constraint)
           
abstract  void removeRigidBody(RigidBody body)
           
 void removeVehicle(RaycastVehicle vehicle)
           
abstract  void setConstraintSolver(ConstraintSolver solver)
           
abstract  void setGravity(Vector3f gravity)
          Once a rigidbody is added to the dynamics world, it will get this gravity assigned.
 void setInternalTickCallback(InternalTickCallback cb, Object worldUserInfo)
          Set the callback for when an internal tick (simulation substep) happens, optional user info.
 void setWorldUserInfo(Object worldUserInfo)
           
 int stepSimulation(float timeStep)
           
 int stepSimulation(float timeStep, int maxSubSteps)
           
abstract  int stepSimulation(float timeStep, int maxSubSteps, float fixedTimeStep)
          Proceeds the simulation over 'timeStep', units in preferably in seconds.
 
Methods inherited from class com.bulletphysics.collision.dispatch.CollisionWorld
addCollisionObject, addCollisionObject, convexSweepTest, destroy, getBroadphase, getCollisionObjectArray, getDebugDrawer, getDispatcher, getDispatchInfo, getNumCollisionObjects, getPairCache, objectQuerySingle, performDiscreteCollisionDetection, rayTest, rayTestSingle, removeCollisionObject, setBroadphase, setDebugDrawer, updateAabbs, updateSingleAabb
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicsWorld

public DynamicsWorld(Dispatcher dispatcher,
                     BroadphaseInterface broadphasePairCache,
                     CollisionConfiguration collisionConfiguration)
Method Detail

stepSimulation

public final int stepSimulation(float timeStep)

stepSimulation

public final int stepSimulation(float timeStep,
                                int maxSubSteps)

stepSimulation

public abstract int stepSimulation(float timeStep,
                                   int maxSubSteps,
                                   float fixedTimeStep)
Proceeds the simulation over 'timeStep', units in preferably in seconds.

By default, Bullet will subdivide the timestep in constant substeps of each 'fixedTimeStep'.

In order to keep the simulation real-time, the maximum number of substeps can be clamped to 'maxSubSteps'.

You can disable subdividing the timestep/substepping by passing maxSubSteps=0 as second argument to stepSimulation, but in that case you have to keep the timeStep constant.


debugDrawWorld

public abstract void debugDrawWorld()

addConstraint

public final void addConstraint(TypedConstraint constraint)

addConstraint

public void addConstraint(TypedConstraint constraint,
                          boolean disableCollisionsBetweenLinkedBodies)

removeConstraint

public void removeConstraint(TypedConstraint constraint)

addAction

public void addAction(ActionInterface action)

removeAction

public void removeAction(ActionInterface action)

addVehicle

public void addVehicle(RaycastVehicle vehicle)

removeVehicle

public void removeVehicle(RaycastVehicle vehicle)

setGravity

public abstract void setGravity(Vector3f gravity)
Once a rigidbody is added to the dynamics world, it will get this gravity assigned. Existing rigidbodies in the world get gravity assigned too, during this method.


getGravity

public abstract Vector3f getGravity(Vector3f out)

addRigidBody

public abstract void addRigidBody(RigidBody body)

removeRigidBody

public abstract void removeRigidBody(RigidBody body)

setConstraintSolver

public abstract void setConstraintSolver(ConstraintSolver solver)

getConstraintSolver

public abstract ConstraintSolver getConstraintSolver()

getNumConstraints

public int getNumConstraints()

getConstraint

public TypedConstraint getConstraint(int index)

getNumActions

public int getNumActions()

getAction

public ActionInterface getAction(int index)

getWorldType

public abstract DynamicsWorldType getWorldType()

clearForces

public abstract void clearForces()

setInternalTickCallback

public void setInternalTickCallback(InternalTickCallback cb,
                                    Object worldUserInfo)
Set the callback for when an internal tick (simulation substep) happens, optional user info.


setWorldUserInfo

public void setWorldUserInfo(Object worldUserInfo)

getWorldUserInfo

public Object getWorldUserInfo()

getSolverInfo

public ContactSolverInfo getSolverInfo()