Package com.jme3.bullet.debug
Class BulletDebugAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
com.jme3.bullet.debug.BulletDebugAppState
- All Implemented Interfaces:
AppState
An app state to manage a debug visualization of a physics space.
This class is shared between JBullet and Native Bullet.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface to restrict which physics objects are visualized. -
Field Summary
Modifier and TypeFieldDescriptionprotected Application
protected AssetManager
protected HashMap<PhysicsRigidBody,
Spatial> map rigid bodies to visualizationsprotected HashMap<PhysicsCharacter,
Spatial> map physics characters to visualizationsmaterial for inactive rigid bodiesmaterial for jointsmaterial for vehicles and active rigid bodiesmaterial for physics charactersmaterial for ghostsprotected BulletDebugAppState.DebugAppStateFilter
limit which objects are visualized, or null to visualize all objectsprotected HashMap<PhysicsGhostObject,
Spatial> map ghosts to visualizationsprotected HashMap<PhysicsJoint,
Spatial> map joints to visualizationsprotected static final Logger
message logger for this classprotected final Node
scene-graph node to parent the geometriesprotected RenderManager
protected final PhysicsSpace
physics space to visualize (not null)protected HashMap<PhysicsVehicle,
Spatial> map vehicles to visualizationsprotected ViewPort
view port in which to render (not null)Fields inherited from class com.jme3.app.state.AbstractAppState
initialized
-
Constructor Summary
ConstructorDescriptionBulletDebugAppState
(PhysicsSpace space) Instantiate an app state to visualize the specified space. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanup()
Transition this state from terminating to detached.void
initialize
(AppStateManager stateManager, Application app) Initialize this state prior to its 1st update.void
render
(RenderManager rm) Render this state.void
Alter which objects are visualized.void
update
(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
-
assetManager
-
space
physics space to visualize (not null) -
physicsDebugRootNode
scene-graph node to parent the geometries -
viewPort
view port in which to render (not null) -
rm
-
DEBUG_BLUE
material for inactive rigid bodies -
DEBUG_RED
-
DEBUG_GREEN
material for joints -
DEBUG_YELLOW
material for ghosts -
DEBUG_MAGENTA
material for vehicles and active rigid bodies -
DEBUG_PINK
material 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
Initialize this state prior to its 1st update. Should be invoked only by a subclass or by the AppStateManager.- Specified by:
initialize
in interfaceAppState
- Overrides:
initialize
in classAbstractAppState
- 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:
cleanup
in interfaceAppState
- Overrides:
cleanup
in classAbstractAppState
-
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:
update
in interfaceAppState
- Overrides:
update
in classAbstractAppState
- Parameters:
tpf
- the time interval between frames (in seconds, ≥0)
-
render
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:
render
in interfaceAppState
- Overrides:
render
in classAbstractAppState
- Parameters:
rm
- the render manager (not null)
-