Package com.jme3.bullet.objects.infos
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
applyTransform
(Spatial spatial) applies the current transform to the given jme Node if the location has been updated on the physics sidecom.bulletphysics.linearmath.Transform
getWorldTransform
(com.bulletphysics.linearmath.Transform t) Called from Bullet when creating the rigid body.boolean
void
setApplyPhysicsLocal
(boolean applyPhysicsLocal) void
setVehicle
(PhysicsVehicle vehicle) void
setWorldTransform
(com.bulletphysics.linearmath.Transform worldTrans) Called from Bullet when the transform of the rigid body changes.
-
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 classcom.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 classcom.bulletphysics.linearmath.MotionState
- Parameters:
worldTrans
- the new value (not null, unaffected)
-
applyTransform
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
- Returns:
- the worldLocation
-
getWorldRotation
- Returns:
- the worldRotation
-
getWorldRotationQuat
- Returns:
- the worldRotationQuat
-
setVehicle
- Parameters:
vehicle
- the vehicle to set
-
isApplyPhysicsLocal
public boolean isApplyPhysicsLocal() -
setApplyPhysicsLocal
public void setApplyPhysicsLocal(boolean applyPhysicsLocal)
-