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 TypeMethodDescriptionint
Count the active references to the nativeSkeletonMapper
.void
initialize
(ConstSkeleton skeleton1, Mat44Array neutralPose1, ConstSkeleton skeleton2, Mat44Array neutralPose2) Initialize the skeleton mapper as specified.void
lockAllTranslations
(ConstSkeleton skeleton2, Mat44Array neutralPose2) Lock the translations of specified joints in the target skeleton.void
map
(Mat44Array pose1ModelSpace, Mat44Array pose2LocalSpace, Mat44Array storePose2ModelSpace) Map the specified pose.void
mapReverse
(Mat44Array pose2ModelSpace, Mat44Array storePose1ModelSpace) Reverse map a pose.void
Mark the nativeSkeletonMapper
as embedded.toRef()
Create a counted reference to the nativeShape
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, 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 (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
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
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 nativeSkeletonMapper
. The mapper is unaffected.- Specified by:
getRefCount
in interfaceRefTarget
- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeSkeletonMapper
as embedded.- Specified by:
setEmbedded
in interfaceRefTarget
-
toRef
Create a counted reference to the nativeShape
.
-