Class Ragdoll

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

public class Ragdoll extends NonCopyable implements RefTarget
Runtime information to simulate a ragdoll composed of bodies connected by constraints.
  • 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)
    • driveToPoseUsingMotors

      public void driveToPoseUsingMotors(SkeletonPose pose)
      Drive the ragdoll to the specified pose using motors.
      Parameters:
      pose - the desired pose (not null, unaffected)
    • 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
    • getRefCount

      public int getRefCount()
      Count the active references to the native Ragdoll. The ragdoll is unaffected.
      Specified by:
      getRefCount in interface RefTarget
      Returns:
      the count (≥0)
    • setEmbedded

      public void setEmbedded()
      Mark the native Ragdoll as embedded.
      Specified by:
      setEmbedded in interface RefTarget
    • toRef

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