java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SkeletonPose
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A skeleton with joint transforms specifying a pose.
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate a default pose.SkeletonPose
(SkeletonPose original) Instantiate a clone of the specified pose. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Convert the joint transforms to matrices.void
Convert the joint matrices to joint states.void
calculateLocalSpaceJointMatrices
(Mat44Array storeMatrices) Calculate the joint matrices in local space.void
draw
(SkeletonPoseDrawSettings settings, DebugRenderer renderer) Draw the current pose using the specified settings and renderer.void
draw
(SkeletonPoseDrawSettings settings, DebugRenderer renderer, RMat44Arg transform) Draw the current pose using the specified settings and renderer.getJoint
(int jointIndex) Access the transforms of the specified joint.int
Count how many joints are in the pose.Copy the joint matrices.getJointMatrix
(int jointIndex) Access the transform matrix for the specified joint.Copy the root offset.Access the skeleton that underlies this pose.void
setRootOffset
(RVec3Arg offset) Alter the root offset.void
setSkeleton
(ConstSkeleton skeleton) Replace the skeleton.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
SkeletonPose
public SkeletonPose()Instantiate a default pose. -
SkeletonPose
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
Calculate the joint matrices in local space.- Parameters:
storeMatrices
- storage for the matrices (not null, modified)
-
draw
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
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
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
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
Copy the joint matrices.- Returns:
- a new JVM object with the pre-existing native object assigned
-
getRootOffset
Copy the root offset.- Returns:
- a new vector
-
getSkeleton
Access the skeleton that underlies this pose.- Returns:
- a new JVM object with the pre-existing native object assigned
-
setRootOffset
Alter the root offset.- Parameters:
offset
- the desired offset (not null, unaffected)
-
setSkeleton
Replace the skeleton.- Parameters:
skeleton
- the desired skeleton (not null)
-