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

public final class RagdollRef extends Ref
A counted reference to a Ragdoll.
  • Constructor Details

    • RagdollRef

      public RagdollRef()
      Instantiate an empty reference.
  • Method Details

    • addToPhysicsSystem

      public void addToPhysicsSystem(EActivation activation)
      Add bodies and constraints to the physics system and optionally activate the bodies.
      Parameters:
      activation - whether to activate bodies (not null)
    • driveToPoseUsingKinematics

      public void driveToPoseUsingKinematics(SkeletonPose pose, float time)
      Drive the ragdoll to the specified pose by setting velocities.
      Parameters:
      pose - the desired pose
      time - time to achieve the pose (in seconds)
    • driveToPoseUsingKinematics

      public void driveToPoseUsingKinematics(SkeletonPose pose, float time, boolean lockBodies)
      Drive the ragdoll to the specified pose by setting velocities.
      Parameters:
      pose - the desired pose
      time - time to achieve the pose (in seconds)
      lockBodies - (default=true)
    • driveToPoseUsingMotors

      public void driveToPoseUsingMotors(SkeletonPose pose)
      Drive the ragdoll to the specified pose using motors.
      Parameters:
      pose - the desired pose (not null, unaffected)
    • getBodyCount

      public int getBodyCount()
      Count how many bodies are in the ragdoll, which is unaffected
      Returns:
      the count (≥0)
    • getBodyIds

      public int[] getBodyIds()
      Enumerate all bodies in the ragdoll, which is unaffected. (native method: GetBodyIDs)
      Returns:
      a new array of body IDs
    • getConstraintCount

      public int getConstraintCount()
      Count how many constraints are in the ragdoll, which is unaffected.
      Returns:
      the count (≥0)
    • getPose

      public void getPose(RVec3 storeRootOffset, Mat44Array storeJointMatrices)
      Copy the low-level pose using a locking body interface.
      Parameters:
      storeRootOffset - storage for the root offset (not null, modified)
      storeJointMatrices - storage for the joint matrices (not null, modified)
    • getPose

      public void getPose(RVec3 storeRootOffset, Mat44Array storeJointMatrices, boolean lockBodies)
      Copy the low-level pose.
      Parameters:
      storeRootOffset - storage for the root offset (not null, modified)
      storeJointMatrices - storage for the joint matrices (not null, modified)
      lockBodies - true → use the locking body interface, false → use the non-locking body interface (default=true)
    • getRootTransform

      public void getRootTransform(RVec3 storeLocation, Quat storeOrientation)
      Copy the transform of the ragdoll's root, using the locking body interface. The ragdoll is unaffected.
      Parameters:
      storeLocation - storage for the root location (not null, modified)
      storeOrientation - storage for the root orientation (not null, modified)
    • getRootTransform

      public void getRootTransform(RVec3 storeLocation, Quat storeOrientation, boolean lockBodies)
      Copy the transform of the ragdoll's root. The ragdoll is unaffected.
      Parameters:
      storeLocation - storage for the root location (not null, modified)
      storeOrientation - storage for the root orientation (not null, modified)
      lockBodies - true → use the locking body interface, false → use the non-locking body interface (default=true)
    • removeFromPhysicsSystem

      public void removeFromPhysicsSystem()
      Remove bodies and constraints from the physics system.
    • setPose

      public void setPose(SkeletonPose pose)
      Alter the ragdoll's pose using the locking body interface.
      Parameters:
      pose - the desired pose (not null, unaffected)
    • setPose

      public void setPose(SkeletonPose pose, boolean lockBodies)
      Alter the ragdoll's pose.
      Parameters:
      pose - the desired pose (not null, unaffected)
      lockBodies - true→use the locking body interface, false→use the non-locking body interface
    • getPtr

      public Ragdoll getPtr()
      Temporarily access the referenced Ragdoll.
      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 Ragdoll. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      a virtual address (not zero)
    • toRef

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