Package com.jme3.bullet.debug
Class BulletDebugAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
com.jme3.bullet.debug.BulletDebugAppState
- All Implemented Interfaces:
com.jme3.app.state.AppState
public class BulletDebugAppState
extends com.jme3.app.state.AbstractAppState
An app state to manage a debug visualization of a physics space.
This class is shared between JBullet and Native Bullet.
- Author:
- normenhansen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface to restrict which physics objects are visualized. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.jme3.app.Applicationprotected com.jme3.asset.AssetManagerprotected HashMap<PhysicsRigidBody, com.jme3.scene.Spatial> map rigid bodies to visualizationsprotected HashMap<PhysicsCharacter, com.jme3.scene.Spatial> map physics characters to visualizationscom.jme3.material.Materialmaterial for inactive rigid bodiescom.jme3.material.Materialmaterial for jointscom.jme3.material.Materialmaterial for vehicles and active rigid bodiescom.jme3.material.Materialmaterial for physics characterscom.jme3.material.Materialcom.jme3.material.Materialmaterial for ghostsprotected BulletDebugAppState.DebugAppStateFilterlimit which objects are visualized, or null to visualize all objectsprotected HashMap<PhysicsGhostObject, com.jme3.scene.Spatial> map ghosts to visualizationsprotected HashMap<PhysicsJoint, com.jme3.scene.Spatial> map joints to visualizationsprotected static final Loggermessage logger for this classprotected final com.jme3.scene.Nodescene-graph node to parent the geometriesprotected com.jme3.renderer.RenderManagerprotected final PhysicsSpacephysics space to visualize (not null)protected HashMap<PhysicsVehicle, com.jme3.scene.Spatial> map vehicles to visualizationsprotected com.jme3.renderer.ViewPortview port in which to render (not null)Fields inherited from class com.jme3.app.state.AbstractAppState
initialized -
Constructor Summary
ConstructorsConstructorDescriptionBulletDebugAppState(PhysicsSpace space) Instantiate an app state to visualize the specified space. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Transition this state from terminating to detached.voidinitialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application app) Initialize this state prior to its 1st update.voidrender(com.jme3.renderer.RenderManager rm) Render this state.voidAlter which objects are visualized.voidupdate(float tpf) Update this state prior to rendering.Methods inherited from class com.jme3.app.state.AbstractAppState
getId, isEnabled, isInitialized, postRender, setEnabled, setId, stateAttached, stateDetached
-
Field Details
-
logger
message logger for this class -
filter
limit which objects are visualized, or null to visualize all objects -
app
protected com.jme3.app.Application app -
assetManager
protected com.jme3.asset.AssetManager assetManager -
space
physics space to visualize (not null) -
physicsDebugRootNode
protected final com.jme3.scene.Node physicsDebugRootNodescene-graph node to parent the geometries -
viewPort
protected com.jme3.renderer.ViewPort viewPortview port in which to render (not null) -
rm
protected com.jme3.renderer.RenderManager rm -
DEBUG_BLUE
public com.jme3.material.Material DEBUG_BLUEmaterial for inactive rigid bodies -
DEBUG_RED
public com.jme3.material.Material DEBUG_RED -
DEBUG_GREEN
public com.jme3.material.Material DEBUG_GREENmaterial for joints -
DEBUG_YELLOW
public com.jme3.material.Material DEBUG_YELLOWmaterial for ghosts -
DEBUG_MAGENTA
public com.jme3.material.Material DEBUG_MAGENTAmaterial for vehicles and active rigid bodies -
DEBUG_PINK
public com.jme3.material.Material DEBUG_PINKmaterial for physics characters -
bodies
map rigid bodies to visualizations -
joints
map joints to visualizations -
ghosts
map ghosts to visualizations -
characters
map physics characters to visualizations -
vehicles
map vehicles to visualizations
-
-
Constructor Details
-
BulletDebugAppState
Instantiate an app state to visualize the specified space. This constructor should be invoked only by BulletAppState.- Parameters:
space- physics space to visualize (not null, alias created)
-
-
Method Details
-
getNewDebugTools
-
setFilter
Alter which objects are visualized.- Parameters:
filter- the desired filter, or null to visualize all objects
-
initialize
public void initialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application app) Initialize this state prior to its 1st update. Should be invoked only by a subclass or by the AppStateManager.- Specified by:
initializein interfacecom.jme3.app.state.AppState- Overrides:
initializein classcom.jme3.app.state.AbstractAppState- Parameters:
stateManager- the manager for this state (not null)app- the application which owns this state (not null)
-
cleanup
public void cleanup()Transition this state from terminating to detached. Should be invoked only by a subclass or by the AppStateManager. Invoked once for each timeinitialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)is invoked.- Specified by:
cleanupin interfacecom.jme3.app.state.AppState- Overrides:
cleanupin classcom.jme3.app.state.AbstractAppState
-
update
public void update(float tpf) Update this state prior to rendering. Should be invoked only by a subclass or by the AppStateManager. Invoked once per frame, provided the state is attached and enabled.- Specified by:
updatein interfacecom.jme3.app.state.AppState- Overrides:
updatein classcom.jme3.app.state.AbstractAppState- Parameters:
tpf- the time interval between frames (in seconds, ≥0)
-
render
public void render(com.jme3.renderer.RenderManager rm) Render this state. Should be invoked only by a subclass or by the AppStateManager. Invoked once per frame, provided the state is attached and enabled.- Specified by:
renderin interfacecom.jme3.app.state.AppState- Overrides:
renderin classcom.jme3.app.state.AbstractAppState- Parameters:
rm- the render manager (not null)
-