Package com.jme3.bullet.debug
Class BulletCharacterDebugControl
java.lang.Object
com.jme3.scene.control.AbstractControl
com.jme3.bullet.debug.AbstractPhysicsDebugControl
com.jme3.bullet.debug.BulletCharacterDebugControl
- 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 PhysicsCharacter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.jme3.scene.SpatialSpatial to visualize lastShape (not null)static final Loggermessage logger for this classFields inherited from class com.jme3.bullet.debug.AbstractPhysicsDebugControl
debugAppStateFields inherited from class com.jme3.scene.control.AbstractControl
enabled, spatial -
Constructor Summary
ConstructorsConstructorDescriptionBulletCharacterDebugControl(BulletDebugAppState debugAppState, PhysicsCharacter ch) Instantiate an enabled control to visualize the specified character. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidColor each child of the debug node for a CompoundCollisionShape.protected voidcontrolUpdate(float tpf) Update this control.protected booleanhasShapeChanged(CollisionShape newShape) Compare the specified CollisionShape with the lastShape.protected voidsetShape(CollisionShape shape) Replace the lastShape and update related fields.voidsetSpatial(com.jme3.scene.Spatial spatial) Alter which Spatial is controlled.Methods inherited from class com.jme3.bullet.debug.AbstractPhysicsDebugControl
applyPhysicsTransform, cloneFields, controlRender, jmeClone, read, writeMethods 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
-
BulletCharacterDebugControl
Instantiate an enabled control to visualize the specified character.- Parameters:
debugAppState- which app state (not null, alias created)ch- the character 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:
controlUpdatein 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:
setSpatialin interfacecom.jme3.scene.control.Control- Overrides:
setSpatialin classcom.jme3.scene.control.AbstractControl- Parameters:
spatial- the Spatial to control (or null)
-