Class ArmatureDebugger

java.lang.Object
com.jme3.scene.Spatial
com.jme3.scene.Node
com.jme3.scene.debug.custom.ArmatureDebugger
All Implemented Interfaces:
HasLocalTransform, CloneableSmartAsset, Collidable, Savable, JmeCloneable, Cloneable

public class ArmatureDebugger extends Node
The class that creates a mesh to display how bones behave. If it is supplied with the bones' lengths it will show exactly how the bones look like on the scene. If not then only connections between each bone heads will be shown.
  • Constructor Details

    • ArmatureDebugger

      public ArmatureDebugger()
      Default constructor for `ArmatureDebugger`. Use ArmatureDebugger(String, Armature, List) for a functional instance.
    • ArmatureDebugger

      public ArmatureDebugger(AssetManager assetManager, SkinningControl skControl)
      Convenience constructor that creates an ArmatureDebugger and immediately initializes its materials based on the provided AssetManager and SkinningControl.
      Parameters:
      assetManager - The AssetManager used to load textures and materials for the debug visualization.
      skControl - The SkinningControl from which to extract the Armature and its associated joints.
    • ArmatureDebugger

      public ArmatureDebugger(String name, Armature armature, List<Joint> deformingJoints)
      Creates an `ArmatureDebugger` instance without explicit bone length data. In this configuration, the visual representation will consist of wires connecting the bone heads, and points representing the bone heads. No dotted lines for inter-bone connections will be visible.
      Parameters:
      name - The name of this debugger's root node.
      armature - The Armature to be visualized.
      deformingJoints - A List of Joint objects that are considered deforming joints.
  • Method Details

    • displayNonDeformingJoint

      public void displayNonDeformingJoint(boolean display)
      Sets the visibility of non-deforming joints and their associated outlines and wires.
      Parameters:
      display - `true` to make non-deforming joints visible, `false` to hide them.
    • initialize

      public void initialize(AssetManager assetManager, Camera camera)
      Initializes the materials and camera for the debugger's visual components. This method should be called after the `ArmatureDebugger` is added to a scene graph and an AssetManager and Camera are available.
      Parameters:
      assetManager - The AssetManager to load textures and materials.
      camera - The scene's primary Camera, used by the `ArmatureNode` for billboard rendering of joint points.
    • getArmature

      public Armature getArmature()
      Returns the Armature instance associated with this debugger.
      Returns:
      The Armature being debugged.
    • updateLogicalState

      public void updateLogicalState(float tpf)
      Description copied from class: Spatial
      updateLogicalState calls the update() method for all controls attached to this Spatial.
      Overrides:
      updateLogicalState in class Node
      Parameters:
      tpf - Time per frame.
      See Also:
    • collideWith

      public int collideWith(Collidable other, CollisionResults results)
      Description copied from interface: Collidable
      Check collision with another Collidable.
      Specified by:
      collideWith in interface Collidable
      Overrides:
      collideWith in class Node
      Parameters:
      other - The object to check collision against
      results - Will contain the list of CollisionResults.
      Returns:
      how many collisions were found between this and other
    • select

      protected Joint select(Geometry geo)
      Selects and returns the Joint associated with a given Geometry. This is an internal helper method, likely used for picking operations.
      Parameters:
      geo - The Geometry representing a part of a joint.
      Returns:
      The Joint corresponding to the geometry, or `null` if not found.
    • getBoneShapes

      public ArmatureNode getBoneShapes()
      Returns the ArmatureNode which is responsible for generating and managing the visual mesh of the bones and wires.
      Returns:
      The ArmatureNode instance.
    • getInterJointWires

      public ArmatureInterJointsWire getInterJointWires()
      Returns the ArmatureInterJointsWire instance, which represents the dotted lines connecting a bone's tail to the head of its children. This will be `null` if the debugger was created without bone length data.
      Returns:
      The ArmatureInterJointsWire instance, or `null` if not present.