Package com.jme3.bullet.control
Interface PhysicsControl
- All Known Implementing Classes:
AbstractPhysicsControl
,BetterCharacterControl
,CharacterControl
,DacConfiguration
,DacLinks
,DynamicAnimControl
,GhostControl
,KinematicRagdollControl
,RigidBodyControl
,VehicleControl
An interface for a scene-graph control that links a physics object to a
Spatial.
This interface is shared between JBullet and Native Bullet.
-
Method Summary
Modifier and TypeMethodDescriptionAccess the physics space to which the object is (or would be) added.boolean
Test whether this control is enabled.void
setEnabled
(boolean state) Enable or disable this control.void
setPhysicsSpace
(PhysicsSpace space) If enabled, add this control's physics object to the specified physics space.Methods inherited from interface com.jme3.scene.control.Control
cloneForSpatial, render, setSpatial, update
-
Method Details
-
setPhysicsSpace
If enabled, add this control's physics object to the specified physics space. In not enabled, alter where the object would be added. The object is removed from any other space it's currently in.- Parameters:
space
- where to add, or null to simply remove
-
getPhysicsSpace
PhysicsSpace getPhysicsSpace()Access the physics space to which the object is (or would be) added.- Returns:
- the pre-existing space, or null for none
-
setEnabled
void setEnabled(boolean state) Enable or disable this control.The physics object is removed from its physics space when the control is disabled. When the control is enabled again, the physics object is moved to the current location of the spatial and then added to the physics space.
- Parameters:
state
- true→enable the control, false→disable it
-
isEnabled
boolean isEnabled()Test whether this control is enabled.- Returns:
- true if enabled, otherwise false
-