The dynamics engine is an impulse based rigid body physics simulator. The simulation
by default uses SI (m/kg/s) units. This can be changed, but all settings within the
Settings singleton must be set to the new units. Instead
its recommended to use the
UnitConversion class to convert all
values to MKS.
A constraint based approach is used to solving contacts and joints.
World object to gain access the dynamics engine. Create
Bodys and add them to the
World.update(double) method to your game loop (notice the
World.update(double) method requires the elapsed time to
be in seconds).
Upon creating a
object may be supplied. The
Bounds will determine when
Bodys go out of bounds and deactivate them. Using the
World() constructor will create a world that has no bounds,
in which case the
World.getBounds() method will return null.
World object also contains a number listeners that can be used to
respond to events that happen within the world, contact for instance.
BoundsListenerfor responding to out of bounds bodies
DestructionListenerfor responding to bodies and joints that are implicitly destroyed by some other action
StepListenerfor performing logic at the end/beginning of a time step
CollisionListenerfor responding to collision detection events
ContactListenerfor responding to contact events
RaycastListenerfor responding to raycast events
TimeOfImpactListenerfor responding to time of impact events
Worldobject may not be allowed inside the listener methods.
The dynamics engine may require some configuration. The defaults should cover most applications,
however, they can be changed using the
Settings class on the
World. Any setting can be changed at runtime so that no source code
modification is needed. Refer to the source of
Settings and the
Sandbox for details on what each individual setting controls.
- William Bittle
Interface Summary Interface Description CoefficientMixerInterface used to customize the way friction and restitution coefficients are mixed. CollisionListenerInterface to listen for collision events. ConvexCastListenerInterface to listen for convex cast events. DestructionListenerInterface to listen for implicit destruction events. DetectListenerInterface to listen for detection events from the
RaycastListenerInterface for listening for raycast events. StepListenerListener notified before and after a simulation step by the
TimeOfImpactListenerInterface to listen for time of impact events.
Class Summary Class Description AABBBroadphaseFilter BodyRepresents a physical
BodyFixtureRepresents a piece of a
BodyIterator CapacityRepresents the estimated number of objects of different types. CollisionAdapterConvenience class for implementing the
ConstraintRepresents some physical constraint between a pair of
ContactEdgeRepresents an interaction of a body in an interaction graph via a
ConvexCastAdapterDefault implementation of the
ConvexCastResultRepresents the result of a convex cast. DestructionAdapterConvenience class for implementing the
DetectAdapterConvenience class for implementing the
DetectBroadphaseFilter DetectResultRepresents the result of a static detection of the world. ForceRepresents a force. InteractionEdge<T>Represents an interaction of a body in an interaction graph. IslandUsed to solve the contact constraints and joints for a group of interconnected bodies. JointEdgeRepresents an interaction of a body in an interaction graph via a
JointIterator RaycastAdapterDefault implementation of the
BroadphaseDetector.raycast(Ray, double, BroadphaseFilter)method.
RaycastResultRepresents the result of a raycast. SettingsResponsible for housing all of the dynamics engine's settings. StepClass encapsulating the timestep information. StepAdapterConvenience class for implementing the
TimeOfImpactAdapterConvenience class for implementing the
TorqueRepresents a torque about the z-axis. WorldManages the logic of collision detection, resolution, and reporting.
Enum Summary Enum Description ContinuousDetectionModeEnumeration of Continuous Collision Detection modes.