Class SkeletonMapper

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

public class SkeletonMapper extends JoltPhysicsObject implements RefTarget
Map poses between a low-detail skeleton and a high-detail one.
  • Constructor Details

    • SkeletonMapper

      public SkeletonMapper()
      Instantiate a default mapper.
  • Method Details

    • initialize

      public void initialize(ConstSkeleton skeleton1, Mat44Array neutralPose1, ConstSkeleton skeleton2, Mat44Array neutralPose2)
      Initialize the skeleton mapper as specified.
      Parameters:
      skeleton1 - source skeleton to map from (not null, unaffected)
      neutralPose1 - neutral pose of the source skeleton (in model space, not null, unaffected)
      skeleton2 - target skeleton to map to (not null, unaffected)
      neutralPose2 - neutral pose of the target skeleton (in model space, not null, unaffected)
    • lockAllTranslations

      public void lockAllTranslations(ConstSkeleton skeleton2, Mat44Array neutralPose2)
      Lock the translations of specified joints in the target skeleton.
      Parameters:
      skeleton2 - the target skeleton (not null, unaffected)
      neutralPose2 - the desired pose (not null, unaffected)
    • map

      public void map(Mat44Array pose1ModelSpace, Mat44Array pose2LocalSpace, Mat44Array storePose2ModelSpace)
      Map the specified pose.
      Parameters:
      pose1ModelSpace - the pose on skeleton 1 (in model space, not null, unaffected)
      pose2LocalSpace - the pose on skeleton 2 (in local space, not null, unaffected)
      storePose2ModelSpace - storage for the resulting pose on skeleton 2 (in model space, not null, all elements non-null, modified)
    • mapReverse

      public void mapReverse(Mat44Array pose2ModelSpace, Mat44Array storePose1ModelSpace)
      Reverse map a pose.
      Parameters:
      pose2ModelSpace - a model-space pose on skeleton 2 (not null, unaffected)
      storePose1ModelSpace - storage for the model space pose on skeleton 1 (not null, all elements non-null, modified)
    • getRefCount

      public int getRefCount()
      Count the active references to the native SkeletonMapper. The mapper is unaffected.
      Specified by:
      getRefCount in interface RefTarget
      Returns:
      the count (≥0)
    • setEmbedded

      public void setEmbedded()
      Mark the native SkeletonMapper as embedded.
      Specified by:
      setEmbedded in interface RefTarget
    • toRef

      public SkeletonMapperRef toRef()
      Create a counted reference to the native Shape.
      Specified by:
      toRef in interface RefTarget
      Returns:
      a new JVM object with a new native object assigned