java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SkeletonMapper
- All Implemented Interfaces:
ConstJoltPhysicsObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Map poses between a low-detail skeleton and a high-detail one.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCount the active references to the nativeSkeletonMapper.voidinitialize(ConstSkeleton skeleton1, Mat44Array neutralPose1, ConstSkeleton skeleton2, Mat44Array neutralPose2) Initialize the skeleton mapper as specified.voidlockAllTranslations(ConstSkeleton skeleton2, Mat44Array neutralPose2) Lock the translations of specified joints in the target skeleton.voidmap(Mat44Array pose1ModelSpace, Mat44Array pose2LocalSpace, Mat44Array storePose2ModelSpace) Map the specified pose.voidmapReverse(Mat44Array pose2ModelSpace, Mat44Array storePose1ModelSpace) Reverse map a pose.voidMark the nativeSkeletonMapperas embedded.toRef()Create a counted reference to the current mapper.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, targetVaOrZero, toString, va
-
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 (notnull, unaffected)neutralPose1- neutral pose of the source skeleton (in model space, notnull, unaffected)skeleton2- target skeleton to map to (notnull, unaffected)neutralPose2- neutral pose of the target skeleton (in model space, notnull, unaffected)
-
lockAllTranslations
Lock the translations of specified joints in the target skeleton.- Parameters:
skeleton2- the target skeleton (notnull, unaffected)neutralPose2- the desired pose (notnull, 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, notnull, unaffected)pose2LocalSpace- the pose on skeleton 2 (in local space, notnull, unaffected)storePose2ModelSpace- storage for the resulting pose on skeleton 2 (in model space, notnull, all elements non-null, modified)
-
mapReverse
Reverse map a pose.- Parameters:
pose2ModelSpace- a model-space pose on skeleton 2 (notnull, unaffected)storePose1ModelSpace- storage for the model space pose on skeleton 1 (notnull, all elements non-null, modified)
-
getRefCount
public int getRefCount()Count the active references to the nativeSkeletonMapper. The mapper is unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeSkeletonMapperas embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the current mapper.
-