All Implemented Interfaces:
ConstJoltPhysicsObject, ConstSkeleton, AutoCloseable, Comparable<JoltPhysicsObject>

public final class SkeletonRef extends Ref implements ConstSkeleton
A counted reference to a Skeleton. (native type: Ref<Skeleton>)
  • 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 interface ConstSkeleton
      Returns:
      true if in order, otherwise false
    • getJoint

      public Joint getJoint(int jointIndex)
      Access the specified joint.
      Specified by:
      getJoint in interface ConstSkeleton
      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 interface ConstSkeleton
      Returns:
      the count (≥0)
    • getJointIndex

      public int getJointIndex(String name)
      Find the index of the named joint.
      Specified by:
      getJointIndex in interface ConstSkeleton
      Parameters:
      name - the name of the joint to find (not null)
      Returns:
      the joint index
    • getJoints

      public Joint[] getJoints()
      Access all the joints.
      Specified by:
      getJoints in interface ConstSkeleton
      Returns:
      a new array of new JVM objects with the pre-existing native objects assigned
    • saveBinaryState

      public void saveBinaryState(StreamOut stream)
      Save the skeleton to the specified binary stream.
      Specified by:
      saveBinaryState in interface ConstSkeleton
      Parameters:
      stream - the stream to write to (not null)
    • getPtr

      public Skeleton getPtr()
      Temporarily access the referenced Skeleton.
      Specified by:
      getPtr in class Ref
      Returns:
      a new JVM object with the pre-existing native object assigned
    • targetVa

      public long targetVa()
      Return the address of the native Skeleton. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      a virtual address (not zero)
    • toRef

      public SkeletonRef toRef()
      Create another counted reference to the native Skeleton.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned