Package com.jme3.bullet.objects.infos
Class RigidBodyMotionState
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.objects.infos.RigidBodyMotionState
- All Implemented Interfaces:
Comparable<NativePhysicsObject>
The motion state (transform) of a rigid body, with thread-safe access.
-
Field Summary
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetLocation
(Vector3f storeResult) Copy the location to a Vector3f.getLocationDp
(Vec3d storeResult) Copy the location to a Vector3d.getOrientation
(Matrix3f storeResult) Copy the orientation to a Matrix3f.getOrientation
(Quaternion storeResult) Copy the orientation to a Quaternion.getOrientationMatrixDp
(Matrix3d storeResult) Copy the orientation to a Matrix3d.getOrientationQuaternionDp
(Quatd storeResult) Copy the orientation to a Quatd.boolean
Test whether physics-space coordinates should match the spatial's local coordinates.physicsTransform
(Transform storeResult) Calculate the body's physics transform.void
setApplyPhysicsLocal
(boolean applyPhysicsLocal) Alter whether physics-space coordinates should match the spatial's local coordinates.void
setVehicle
(PhysicsVehicle vehicle) Alter which vehicle uses this motion state.Methods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, toString, unassignNativeObject
-
Field Details
-
logger
message logger for this class
-
-
Constructor Details
-
RigidBodyMotionState
public RigidBodyMotionState()Instantiate a motion state.
-
-
Method Details
-
getLocation
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
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
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
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
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
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
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
Alter which vehicle uses this motion state.- Parameters:
vehicle
- the desired vehicle, or null for none (alias created)
-