public class BulletDebugAppState extends AbstractAppState
This class is shared between JBullet and Native Bullet.
Modifier and Type | Class and Description |
---|---|
static interface |
BulletDebugAppState.DebugAppStateFilter
Interface to restrict which physics objects are visualized.
|
Modifier and Type | Field and Description |
---|---|
protected Application |
app |
protected AssetManager |
assetManager |
protected java.util.HashMap<PhysicsRigidBody,Spatial> |
bodies
map rigid bodies to visualizations
|
protected java.util.HashMap<PhysicsCharacter,Spatial> |
characters
map physics characters to visualizations
|
Material |
DEBUG_BLUE
material for inactive rigid bodies
|
Material |
DEBUG_GREEN
material for joints
|
Material |
DEBUG_MAGENTA
material for vehicles and active rigid bodies
|
Material |
DEBUG_PINK
material for physics characters
|
Material |
DEBUG_RED |
Material |
DEBUG_YELLOW
material for ghosts
|
protected BulletDebugAppState.DebugAppStateFilter |
filter
limit which objects are visualized, or null to visualize all objects
|
protected java.util.HashMap<PhysicsGhostObject,Spatial> |
ghosts
map ghosts to visualizations
|
protected java.util.HashMap<PhysicsJoint,Spatial> |
joints
map joints to visualizations
|
protected static java.util.logging.Logger |
logger
message logger for this class
|
protected Node |
physicsDebugRootNode
scene-graph node to parent the geometries
|
protected RenderManager |
rm |
protected PhysicsSpace |
space
physics space to visualize (not null)
|
protected java.util.HashMap<PhysicsVehicle,Spatial> |
vehicles
map vehicles to visualizations
|
protected ViewPort |
viewPort
view port in which to render (not null)
|
initialized
Constructor and Description |
---|
BulletDebugAppState(PhysicsSpace space)
Instantiate an app state to visualize the specified space.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Transition this state from terminating to detached.
|
DebugTools |
getNewDebugTools() |
void |
initialize(AppStateManager stateManager,
Application app)
Initialize this state prior to its 1st update.
|
void |
render(RenderManager rm)
Render this state.
|
void |
setFilter(BulletDebugAppState.DebugAppStateFilter filter)
Alter which objects are visualized.
|
void |
update(float tpf)
Update this state prior to rendering.
|
getId, isEnabled, isInitialized, postRender, setEnabled, setId, stateAttached, stateDetached
protected static final java.util.logging.Logger logger
protected BulletDebugAppState.DebugAppStateFilter filter
protected Application app
protected AssetManager assetManager
protected final PhysicsSpace space
protected final Node physicsDebugRootNode
protected ViewPort viewPort
protected RenderManager rm
public Material DEBUG_BLUE
public Material DEBUG_RED
public Material DEBUG_GREEN
public Material DEBUG_YELLOW
public Material DEBUG_MAGENTA
public Material DEBUG_PINK
protected java.util.HashMap<PhysicsRigidBody,Spatial> bodies
protected java.util.HashMap<PhysicsJoint,Spatial> joints
protected java.util.HashMap<PhysicsGhostObject,Spatial> ghosts
protected java.util.HashMap<PhysicsCharacter,Spatial> characters
protected java.util.HashMap<PhysicsVehicle,Spatial> vehicles
public BulletDebugAppState(PhysicsSpace space)
space
- physics space to visualize (not null, alias created)public DebugTools getNewDebugTools()
public void setFilter(BulletDebugAppState.DebugAppStateFilter filter)
filter
- the desired filter, or or null to visualize all objectspublic void initialize(AppStateManager stateManager, Application app)
initialize
in interface AppState
initialize
in class AbstractAppState
stateManager
- the manager for this state (not null)app
- the application which owns this state (not null)public void cleanup()
initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)
is invoked.cleanup
in interface AppState
cleanup
in class AbstractAppState
public void update(float tpf)
update
in interface AppState
update
in class AbstractAppState
tpf
- the time interval between frames (in seconds, ≥0)public void render(RenderManager rm)
render
in interface AppState
render
in class AbstractAppState
rm
- the render manager (not null)