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
  • Field Details

    • logger

      protected static final Logger 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

      protected final PhysicsSpace space
      physics space to visualize (not null)
    • physicsDebugRootNode

      protected final com.jme3.scene.Node physicsDebugRootNode
      scene-graph node to parent the geometries
    • viewPort

      protected com.jme3.renderer.ViewPort viewPort
      view port in which to render (not null)
    • rm

      protected com.jme3.renderer.RenderManager rm
    • DEBUG_BLUE

      public com.jme3.material.Material DEBUG_BLUE
      material for inactive rigid bodies
    • DEBUG_RED

      public com.jme3.material.Material DEBUG_RED
    • DEBUG_GREEN

      public com.jme3.material.Material DEBUG_GREEN
      material for joints
    • DEBUG_YELLOW

      public com.jme3.material.Material DEBUG_YELLOW
      material for ghosts
    • DEBUG_MAGENTA

      public com.jme3.material.Material DEBUG_MAGENTA
      material for vehicles and active rigid bodies
    • DEBUG_PINK

      public com.jme3.material.Material DEBUG_PINK
      material for physics characters
    • bodies

      protected HashMap<PhysicsRigidBody,com.jme3.scene.Spatial> bodies
      map rigid bodies to visualizations
    • joints

      protected HashMap<PhysicsJoint,com.jme3.scene.Spatial> joints
      map joints to visualizations
    • ghosts

      protected HashMap<PhysicsGhostObject,com.jme3.scene.Spatial> ghosts
      map ghosts to visualizations
    • characters

      protected HashMap<PhysicsCharacter,com.jme3.scene.Spatial> characters
      map physics characters to visualizations
    • vehicles

      protected HashMap<PhysicsVehicle,com.jme3.scene.Spatial> vehicles
      map vehicles to visualizations
  • Constructor Details

    • BulletDebugAppState

      public BulletDebugAppState(PhysicsSpace space)
      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

      public DebugTools getNewDebugTools()
    • setFilter

      public void setFilter(BulletDebugAppState.DebugAppStateFilter filter)
      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:
      initialize in interface com.jme3.app.state.AppState
      Overrides:
      initialize in class com.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 time initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application) is invoked.
      Specified by:
      cleanup in interface com.jme3.app.state.AppState
      Overrides:
      cleanup in class com.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:
      update in interface com.jme3.app.state.AppState
      Overrides:
      update in class com.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:
      render in interface com.jme3.app.state.AppState
      Overrides:
      render in class com.jme3.app.state.AbstractAppState
      Parameters:
      rm - the render manager (not null)