Package com.github.stephengold.joltjni
Class RagdollSettingsRef
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.RagdollSettingsRef
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<ConstJoltPhysicsObject>
A counted reference to a
RagdollSettings object. (native type:
Ref<RagdollSettings>)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPre-calculate the map used bygetBodyIndexToConstraintIndex().voidPre-calculate the map used bygetConstraintIndexToBodyIdxPair().createRagdoll(int groupId, long userData, PhysicsSystem physicsSystem) Generate a ragdoll instance from the settings, which are unaffected.Part[]getParts()Access the parts by way of a Java array.getPtr()Temporarily access the referencedRagdollSettings.Access the skeleton.booleanStabilize the constraints.toRef()Create a counted reference to the nativeRagdollSettingsRef.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
RagdollSettingsRef
public RagdollSettingsRef()Instantiate an empty reference.
-
-
Method Details
-
calculateBodyIndexToConstraintIndex
public void calculateBodyIndexToConstraintIndex()Pre-calculate the map used bygetBodyIndexToConstraintIndex(). -
calculateConstraintIndexToBodyIdxPair
public void calculateConstraintIndexToBodyIdxPair()Pre-calculate the map used bygetConstraintIndexToBodyIdxPair(). -
createRagdoll
Generate a ragdoll instance from the settings, which are unaffected.- Parameters:
groupId- the collision group for the bodiesuserData- the desired user-data valuephysicsSystem- where to add the bodies and constraints (not null, modified)- Returns:
- a new ragdoll instance, or
nullwhen out of bodies
-
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
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
-
getPtr
Temporarily access the referencedRagdollSettings. -
toRef
Create a counted reference to the nativeRagdollSettingsRef.
-