Class RagdollSettings

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.RagdollSettings
All Implemented Interfaces:
ConstJoltPhysicsObject, RefTarget, AutoCloseable, Comparable<ConstJoltPhysicsObject>

public class RagdollSettings extends JoltPhysicsObject implements RefTarget
Settings and structure used to create a Ragdoll.
  • Method Details

    • calculateBodyIndexToConstraintIndex

      public void calculateBodyIndexToConstraintIndex()
      Pre-calculate the map used by getBodyIndexToConstraintIndex().
    • calculateConstraintIndexToBodyIdxPair

      public void calculateConstraintIndexToBodyIdxPair()
      Pre-calculate the map used by getConstraintIndexToBodyIdxPair().
    • createRagdoll

      public Ragdoll createRagdoll(int groupId, long userData, PhysicsSystem physicsSystem)
      Generate a ragdoll instance from the settings.
      Parameters:
      groupId - the collision group for the bodies
      userData - the desired user-data value
      physicsSystem - where to add the bodies and constraints (not null, modified)
      Returns:
      a new ragdoll instance, or null when out of bodies
    • getParts

      public Part[] getParts()
      Access the parts by way of a Java array. (native attribute: mParts)
      Returns:
      a new array of new JVM objects with pre-existing native objects assigned
    • getSkeleton

      public Skeleton getSkeleton()
      Access the skeleton. (native attribute: mSkeleton)
      Returns:
      a new JVM object with the pre-existing native object assigned
    • stabilize

      public boolean stabilize()
      Stabilize the constraints.
      Returns:
      true if successful, otherwise false
    • getRefCount

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

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

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