com.bulletphysics.linearmath
Class DefaultMotionState

java.lang.Object
  extended by com.bulletphysics.linearmath.MotionState
      extended by com.bulletphysics.linearmath.DefaultMotionState

public class DefaultMotionState
extends MotionState

DefaultMotionState provides a common implementation to synchronize world transforms with offsets.


Field Summary
 Transform centerOfMassOffset
          Center of mass offset transform, used to adjust graphics world transform.
 Transform graphicsWorldTrans
          Current interpolated world transform, used to draw object.
 Transform startWorldTrans
          Initial world transform.
 
Constructor Summary
DefaultMotionState()
          Creates a new DefaultMotionState with all transforms set to identity.
DefaultMotionState(Transform startTrans)
          Creates a new DefaultMotionState with initial world transform and center of mass offset transform set to identity.
DefaultMotionState(Transform startTrans, Transform centerOfMassOffset)
          Creates a new DefaultMotionState with initial world transform and center of mass offset transform.
 
Method Summary
 Transform getWorldTransform(Transform out)
          Returns world transform.
 void setWorldTransform(Transform centerOfMassWorldTrans)
          Sets world transform.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graphicsWorldTrans

public final Transform graphicsWorldTrans
Current interpolated world transform, used to draw object.


centerOfMassOffset

public final Transform centerOfMassOffset
Center of mass offset transform, used to adjust graphics world transform.


startWorldTrans

public final Transform startWorldTrans
Initial world transform.

Constructor Detail

DefaultMotionState

public DefaultMotionState()
Creates a new DefaultMotionState with all transforms set to identity.


DefaultMotionState

public DefaultMotionState(Transform startTrans)
Creates a new DefaultMotionState with initial world transform and center of mass offset transform set to identity.


DefaultMotionState

public DefaultMotionState(Transform startTrans,
                          Transform centerOfMassOffset)
Creates a new DefaultMotionState with initial world transform and center of mass offset transform.

Method Detail

getWorldTransform

public Transform getWorldTransform(Transform out)
Description copied from class: MotionState
Returns world transform.

Specified by:
getWorldTransform in class MotionState

setWorldTransform

public void setWorldTransform(Transform centerOfMassWorldTrans)
Description copied from class: MotionState
Sets world transform. This method is called by JBullet whenever an active object represented by this MotionState is moved or rotated.

Specified by:
setWorldTransform in class MotionState