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 TypeMethodDescriptionboolean
Test whether the joints are correctly ordered, parents before children.getJoint
(int jointIndex) Access the specified joint.int
Count how many joints are in the skeleton.int
getJointIndex
(String name) Find the index of the named joint.Joint[]
Access all the joints.getPtr()
Temporarily access the referencedSkeleton
.void
saveBinaryState
(StreamOut stream) Save the skeleton to the specified binary stream.long
targetVa()
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, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods 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:
areJointsCorrectlyOrdered
in interfaceConstSkeleton
- Returns:
true
if in order, otherwisefalse
-
getJoint
Access the specified joint.- Specified by:
getJoint
in 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:
getJointCount
in interfaceConstSkeleton
- Returns:
- the count (≥0)
-
getJointIndex
Find the index of the named joint.- Specified by:
getJointIndex
in interfaceConstSkeleton
- Parameters:
name
- the name of the joint to find (not null)- Returns:
- the joint index
-
getJoints
Access all the joints.- Specified by:
getJoints
in 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:
saveBinaryState
in 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:
targetVa
in interfaceConstJoltPhysicsObject
- Overrides:
targetVa
in classJoltPhysicsObject
- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeSkeleton
.
-