Class BulletDebugAppState

java.lang.Object
com.jme3.app.state.BaseAppState
com.jme3.bullet.debug.BulletDebugAppState
All Implemented Interfaces:
com.jme3.app.state.AppState
Direct Known Subclasses:
MultiBodyDebugAppState, SoftDebugAppState

public class BulletDebugAppState extends com.jme3.app.state.BaseAppState
An AppState to manage debug visualization of a PhysicsSpace.
  • Field Details

    • logger

      public static final Logger logger
      message logger for this class
    • enableChildColoring

      public static final com.jme3.material.Material enableChildColoring
      fake Material to indicate child coloring of a CompoundCollisionShape
  • Constructor Details

    • BulletDebugAppState

      public BulletDebugAppState(DebugConfiguration config)
      Instantiate an AppState with the specified configuration. This constructor should be invoked only by BulletAppState.
      Parameters:
      config - the desired configuration (not null, alias created)
  • Method Details

    • getRootNode

      public com.jme3.scene.Node getRootNode()
      Access the Node containing all the debug visualization.
      Returns:
      the pre-existing instance, or null if unknown
    • setAngularVelocityFilter

      public void setAngularVelocityFilter(BulletDebugAppState.DebugAppStateFilter filter)
      Alter which angular velocities are visualized. For internal use only.
      Parameters:
      filter - the desired filter, or null to visualize no angular velocities
    • setBoundingBoxFilter

      public void setBoundingBoxFilter(BulletDebugAppState.DebugAppStateFilter filter)
      Alter which bounding boxes are visualized. For internal use only.
      Parameters:
      filter - the desired filter, or null to visualize no bounding boxes
    • setFilter

      public void setFilter(BulletDebugAppState.DebugAppStateFilter filter)
      Alter which physics objects are visualized. For compatibility with the jme3-jbullet library.
      Parameters:
      filter - the desired filter (alias created) or null to visualize all objects
    • setGravityVectorFilter

      public void setGravityVectorFilter(BulletDebugAppState.DebugAppStateFilter filter)
      Alter which gravity vectors are visualized. For internal use only.
      Parameters:
      filter - the desired filter (alias created) or null to visualize no gravity vectors
    • setJointLineWidth

      public void setJointLineWidth(float width)
      Alter the line width for PhysicsJoint arrows. For internal use only.
      Parameters:
      width - (in pixels, ≥1, default=1)
    • setSweptSphereFilter

      public void setSweptSphereFilter(BulletDebugAppState.DebugAppStateFilter filter)
      Alter which swept spheres are visualized. For internal use only.
      Parameters:
      filter - the desired filter, or null to visualize no swept spheres
    • setVelocityVectorFilter

      public void setVelocityVectorFilter(BulletDebugAppState.DebugAppStateFilter filter)
      Alter which velocity vectors are visualized. For internal use only.
      Parameters:
      filter - the desired filter, or null to visualize no velocity vectors
    • attachChild

      protected void attachChild(com.jme3.scene.Spatial spatial)
      Attach the specified Spatial to the debug root node.
      Parameters:
      spatial - the Spatial to attach (not null)
    • createWireMaterial

      protected com.jme3.material.Material createWireMaterial(com.jme3.asset.AssetManager assetManager, com.jme3.math.ColorRGBA color, String name, int numSides)
      Create the specified wireframe material.
      Parameters:
      assetManager - the application's AssetManager (not null)
      color - the desired color (not null, unaffected)
      name - the desired name for the Material
      numSides - the desired number of sides (1 or 2)
      Returns:
      a new instance
    • getPcoMap

      protected HashMap<PhysicsCollisionObject,com.jme3.scene.Node> getPcoMap()
      Access the map from collision objects to transformed visualization nodes.
      Returns:
      the pre-existing instance
    • setupMaterials

      protected void setupMaterials(com.jme3.asset.AssetManager am)
      Initialize the wireframe materials and child materials.
      Parameters:
      am - the application's AssetManager (not null)
    • updateAxes

      protected void updateAxes(com.jme3.scene.Node node, boolean displayShape)
      Update the AxesVisualizer for the specified Node.
      Parameters:
      node - the transformed Node to update (not null)
      displayShape - true shape is visualized, otherwise false
    • updateShapes

      protected void updateShapes()
      Synchronize the collision-shape debug controls and axis visualizers with the collision objects in the PhysicsSpace.
    • updateVelocities

      protected void updateVelocities()
      Synchronize the velocity visualizers with the collision objects in the PhysicsSpace.
    • cleanup

      protected void cleanup(com.jme3.app.Application app)
      Transition this state from terminating to detached. Should be invoked only by a subclass or by the AppStateManager.

      Invoked once for each time BaseAppState.initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application) is invoked.

      Specified by:
      cleanup in class com.jme3.app.state.BaseAppState
      Parameters:
      app - the application which owns this state (not null)
    • initialize

      public void initialize(com.jme3.app.Application app)
      Initialize this state prior to its first update. Should be invoked only by a subclass or by the AppStateManager.
      Specified by:
      initialize in class com.jme3.app.state.BaseAppState
      Parameters:
      app - the application which owns this state (not null)
    • onDisable

      protected void onDisable()
      Transition this state from enabled to disabled.
      Specified by:
      onDisable in class com.jme3.app.state.BaseAppState
    • onEnable

      protected void onEnable()
      Transition this state from disabled to enabled.
      Specified by:
      onEnable in class com.jme3.app.state.BaseAppState
    • 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.BaseAppState
      Parameters:
      rm - the render manager (not null)
    • 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.BaseAppState
      Parameters:
      tpf - the time interval between frames (in seconds, ≥0)