java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SkeletonPose
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class SkeletonPose extends JoltPhysicsObject
A skeleton with joint transforms specifying a pose.
  • Constructor Details

    • SkeletonPose

      public SkeletonPose()
      Instantiate a default pose.
    • SkeletonPose

      public SkeletonPose(SkeletonPose original)
      Instantiate a clone of the specified pose.
      Parameters:
      original - the pose to clone (not null, unaffected)
  • Method Details

    • calculateJointMatrices

      public void calculateJointMatrices()
      Convert the joint transforms to matrices.
    • calculateJointStates

      public void calculateJointStates()
      Convert the joint matrices to joint states.
    • calculateLocalSpaceJointMatrices

      public void calculateLocalSpaceJointMatrices(Mat44Array storeMatrices)
      Calculate the joint matrices in local space.
      Parameters:
      storeMatrices - storage for the matrices (not null, modified)
    • draw

      public void draw(SkeletonPoseDrawSettings settings, DebugRenderer renderer)
      Draw the current pose using the specified settings and renderer. The pose is unaffected.
      Parameters:
      settings - the desired settings (not null, unaffected)
      renderer - the renderer to use (not null)
    • draw

      public void draw(SkeletonPoseDrawSettings settings, DebugRenderer renderer, RMat44Arg transform)
      Draw the current pose using the specified settings and renderer. The pose is unaffected.
      Parameters:
      settings - the desired settings (not null, unaffected)
      renderer - the renderer to use (not null)
      transform - the transform to apply (not null, unaffected, default=Identity)
    • getJoint

      public JointState getJoint(int jointIndex)
      Access the transforms of the specified joint.
      Parameters:
      jointIndex - the index of the joint to access
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getJointCount

      public int getJointCount()
      Count how many joints are in the pose.
      Returns:
      the count (≥0)
    • getJointMatrix

      public Mat44 getJointMatrix(int jointIndex)
      Access the transform matrix for the specified joint.
      Parameters:
      jointIndex - which joint (≥0)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getJointMatrices

      public Mat44Array getJointMatrices()
      Copy the joint matrices.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getRootOffset

      public RVec3 getRootOffset()
      Copy the root offset.
      Returns:
      a new vector
    • getSkeleton

      public ConstSkeleton getSkeleton()
      Access the skeleton that underlies this pose.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • setRootOffset

      public void setRootOffset(RVec3Arg offset)
      Alter the root offset.
      Parameters:
      offset - the desired offset (not null, unaffected)
    • setSkeleton

      public void setSkeleton(ConstSkeleton skeleton)
      Replace the skeleton.
      Parameters:
      skeleton - the desired skeleton (not null)