Class RigidBodyMotionState

java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.objects.infos.RigidBodyMotionState
All Implemented Interfaces:
Comparable<NativePhysicsObject>

public class RigidBodyMotionState extends NativePhysicsObject
The motion state (transform) of a rigid body, with thread-safe access.
  • Field Details

    • logger

      public static final Logger logger
      message logger for this class
  • Constructor Details

    • RigidBodyMotionState

      public RigidBodyMotionState()
      Instantiate a motion state.
  • Method Details

    • getLocation

      public Vector3f getLocation(Vector3f storeResult)
      Copy the location to a Vector3f.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the location vector (in physics-space coordinates, either storeResult or a new vector, not null)
    • getLocationDp

      public Vec3d getLocationDp(Vec3d storeResult)
      Copy the location to a Vector3d.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the location vector (in physics-space coordinates, either storeResult or a new vector, not null, finite)
    • getOrientation

      public Matrix3f getOrientation(Matrix3f storeResult)
      Copy the orientation to a Matrix3f.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the orientation (in physics-space coordinates, either storeResult or a new matrix, not null)
    • getOrientation

      public Quaternion getOrientation(Quaternion storeResult)
      Copy the orientation to a Quaternion.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the orientation (in physics-space coordinates, either storeResult or a new instance, not null)
    • getOrientationMatrixDp

      public Matrix3d getOrientationMatrixDp(Matrix3d storeResult)
      Copy the orientation to a Matrix3d.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the orientation (in physics-space coordinates, either storeResult or a new matrix, not null)
    • getOrientationQuaternionDp

      public Quatd getOrientationQuaternionDp(Quatd storeResult)
      Copy the orientation to a Quatd.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the orientation (in physics-space coordinates, either storeResult or a new instance, not null)
    • isApplyPhysicsLocal

      public boolean isApplyPhysicsLocal()
      Test whether physics-space coordinates should match the spatial's local coordinates.
      Returns:
      true if matching local coordinates, false if matching world coordinates
    • physicsTransform

      public Transform physicsTransform(Transform storeResult)
      Calculate the body's physics transform.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the body's transform in physics-space coordinates (either storeResult or a new instance, not null)
    • setApplyPhysicsLocal

      public void setApplyPhysicsLocal(boolean applyPhysicsLocal)
      Alter whether physics-space coordinates should match the spatial's local coordinates.
      Parameters:
      applyPhysicsLocal - true→match local coordinates, false→match world coordinates (default=false)
    • setVehicle

      public void setVehicle(PhysicsVehicle vehicle)
      Alter which vehicle uses this motion state.
      Parameters:
      vehicle - the desired vehicle, or null for none (alias created)