Class RigidBodyMotionState

java.lang.Object
com.bulletphysics.linearmath.MotionState
com.jme3.bullet.objects.infos.RigidBodyMotionState

public class RigidBodyMotionState extends com.bulletphysics.linearmath.MotionState
stores transform info of a PhysicsNode in a threadsafe manner to allow multithreaded access from the jme scenegraph and the bullet physics space
  • Constructor Details

    • RigidBodyMotionState

      public RigidBodyMotionState()
  • Method Details

    • getWorldTransform

      public com.bulletphysics.linearmath.Transform getWorldTransform(com.bulletphysics.linearmath.Transform t)
      Called from Bullet when creating the rigid body.
      Specified by:
      getWorldTransform in class com.bulletphysics.linearmath.MotionState
      Parameters:
      t - caller-provided storage for the Transform
      Returns:
      t
    • setWorldTransform

      public void setWorldTransform(com.bulletphysics.linearmath.Transform worldTrans)
      Called from Bullet when the transform of the rigid body changes.
      Specified by:
      setWorldTransform in class com.bulletphysics.linearmath.MotionState
      Parameters:
      worldTrans - the new value (not null, unaffected)
    • applyTransform

      public boolean applyTransform(Spatial spatial)
      applies the current transform to the given jme Node if the location has been updated on the physics side
      Parameters:
      spatial - where to apply the physics transform (not null, modified)
      Returns:
      true if changed
    • getWorldLocation

      public Vector3f getWorldLocation()
      Returns:
      the worldLocation
    • getWorldRotation

      public Matrix3f getWorldRotation()
      Returns:
      the worldRotation
    • getWorldRotationQuat

      public Quaternion getWorldRotationQuat()
      Returns:
      the worldRotationQuat
    • setVehicle

      public void setVehicle(PhysicsVehicle vehicle)
      Parameters:
      vehicle - the vehicle to set
    • isApplyPhysicsLocal

      public boolean isApplyPhysicsLocal()
    • setApplyPhysicsLocal

      public void setApplyPhysicsLocal(boolean applyPhysicsLocal)