java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.SkeletonRef
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstSkeleton,AutoCloseable,Comparable<JoltPhysicsObject>
A counted reference to a
Skeleton. (native type:
Ref<Skeleton>)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest whether the joints are correctly ordered, parents before children.getJoint(int jointIndex) Access the specified joint.intCount how many joints are in the skeleton.intgetJointIndex(String name) Find the index of the named joint.Joint[]Access all the joints.getPtr()Temporarily access the referencedSkeleton.voidsaveBinaryState(StreamOut stream) Save the skeleton to the specified binary stream.longtargetVa()Return the address of the nativeSkeleton.toRef()Create another counted reference to the nativeSkeleton.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject
-
Constructor Details
-
SkeletonRef
public SkeletonRef()Instantiate an empty reference.
-
-
Method Details
-
areJointsCorrectlyOrdered
public boolean areJointsCorrectlyOrdered()Test whether the joints are correctly ordered, parents before children.- Specified by:
areJointsCorrectlyOrderedin interfaceConstSkeleton- Returns:
trueif in order, otherwisefalse
-
getJoint
Access the specified joint.- Specified by:
getJointin interfaceConstSkeleton- Parameters:
jointIndex- the index of the joint to access (≥0)- Returns:
- a new JVM object with the pre-existing native object assigned
-
getJointCount
public int getJointCount()Count how many joints are in the skeleton.- Specified by:
getJointCountin interfaceConstSkeleton- Returns:
- the count (≥0)
-
getJointIndex
Find the index of the named joint.- Specified by:
getJointIndexin interfaceConstSkeleton- Parameters:
name- the name of the joint to find (not null)- Returns:
- the joint index
-
getJoints
Access all the joints.- Specified by:
getJointsin interfaceConstSkeleton- Returns:
- a new array of new JVM objects with the pre-existing native objects assigned
-
saveBinaryState
Save the skeleton to the specified binary stream.- Specified by:
saveBinaryStatein interfaceConstSkeleton- Parameters:
stream- the stream to write to (not null)
-
getPtr
Temporarily access the referencedSkeleton. -
targetVa
public long targetVa()Return the address of the nativeSkeleton. No objects are affected.- Specified by:
targetVain interfaceConstJoltPhysicsObject- Overrides:
targetVain classJoltPhysicsObject- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeSkeleton.
-