Package com.jme3.bullet.debug
Class BulletGhostObjectDebugControl
java.lang.Object
com.jme3.scene.control.AbstractControl
com.jme3.bullet.debug.AbstractPhysicsDebugControl
com.jme3.bullet.debug.BulletGhostObjectDebugControl
- All Implemented Interfaces:
com.jme3.export.Savable
,com.jme3.scene.control.Control
,com.jme3.util.clone.JmeCloneable
,Cloneable
A physics-debug control used to visualize a PhysicsGhostObject.
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.jme3.scene.Spatial
Spatial to visualize lastShape (not null)static final Logger
message logger for this classFields inherited from class com.jme3.bullet.debug.AbstractPhysicsDebugControl
debugAppState
Fields inherited from class com.jme3.scene.control.AbstractControl
enabled, spatial
-
Constructor Summary
ConstructorDescriptionBulletGhostObjectDebugControl
(BulletDebugAppState debugAppState, PhysicsGhostObject gh) Instantiate an enabled control to visualize the specified ghost object. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Color each child of the debug node for a CompoundCollisionShape.protected void
controlUpdate
(float tpf) Update this control.protected boolean
hasShapeChanged
(CollisionShape newShape) Compare the specified CollisionShape with the lastShape.protected void
setShape
(CollisionShape shape) Replace the lastShape and update related fields.void
setSpatial
(com.jme3.scene.Spatial spatial) Alter which Spatial is controlled.Methods inherited from class com.jme3.bullet.debug.AbstractPhysicsDebugControl
applyPhysicsTransform, cloneFields, controlRender, jmeClone, read, write
Methods inherited from class com.jme3.scene.control.AbstractControl
cloneForSpatial, getSpatial, isEnabled, render, setEnabled, update
-
Field Details
-
logger
message logger for this class -
debugSpatial
protected com.jme3.scene.Spatial debugSpatialSpatial to visualize lastShape (not null)
-
-
Constructor Details
-
BulletGhostObjectDebugControl
Instantiate an enabled control to visualize the specified ghost object.- Parameters:
debugAppState
- which app state (not null, alias created)gh
- which object to visualize (not null, alias created)
-
-
Method Details
-
controlUpdate
protected void controlUpdate(float tpf) Update this control. Invoked once per frame during the logical-state update, provided the control is enabled and added to a scene. Should be invoked only by a subclass or by AbstractControl.- Specified by:
controlUpdate
in classcom.jme3.scene.control.AbstractControl
- Parameters:
tpf
- the time interval between frames (in seconds, ≥0)
-
colorChildren
protected void colorChildren()Color each child of the debug node for a CompoundCollisionShape. Invoked when child coloring is enabled. -
hasShapeChanged
Compare the specified CollisionShape with the lastShape.- Parameters:
newShape
- the new shape (not null, unaffected)- Returns:
- true if the shape has changed, otherwise false
-
setShape
Replace the lastShape and update related fields.- Parameters:
shape
- (not null, alias created)
-
setSpatial
public void setSpatial(com.jme3.scene.Spatial spatial) Alter which Spatial is controlled. Invoked when the Control is added to or removed from a Spatial. Should be invoked only by a subclass or from Spatial. Do not invoke directly from user code.- Specified by:
setSpatial
in interfacecom.jme3.scene.control.Control
- Overrides:
setSpatial
in classcom.jme3.scene.control.AbstractControl
- Parameters:
spatial
- the Spatial to control (or null)
-