java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.Ragdoll
- All Implemented Interfaces:
ConstJoltPhysicsObject,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Runtime information to simulate a ragdoll composed of bodies connected by
constraints.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddToPhysicsSystem(EActivation activation) Add bodies and constraints to the physics system and optionally activate the bodies.voiddriveToPoseUsingKinematics(SkeletonPose pose, float time) Drive the ragdoll to the specified pose by setting velocities.voiddriveToPoseUsingKinematics(SkeletonPose pose, float time, boolean lockBodies) Drive the ragdoll to the specified pose by setting velocities.voidDrive the ragdoll to the specified pose using motors.intCount how many bodies are in the ragdoll, which is unaffectedint[]Enumerate all bodies in the ragdoll, which is unaffected.intCount how many constraints are in the ragdoll, which is unaffected.voidgetPose(RVec3 storeRootOffset, Mat44Array storeJointMatrices) Copy the low-level pose using a locking body interface.voidgetPose(RVec3 storeRootOffset, Mat44Array storeJointMatrices, boolean lockBodies) Copy the low-level pose.voidgetPose(SkeletonPose storePose) Copy the ragdoll's pose using the locking body interface.voidgetPose(SkeletonPose storePose, boolean lockBodies) Copy the ragdoll's pose.intCount the active references to the nativeRagdoll.voidgetRootTransform(RVec3 storeLocation, Quat storeOrientation) Copy the transform of the ragdoll's root, using the locking body interface.voidgetRootTransform(RVec3 storeLocation, Quat storeOrientation, boolean lockBodies) Copy the transform of the ragdoll's root.voidRemove bodies and constraints from the physics system.voidMark the nativeRagdollas embedded.voidsetPose(SkeletonPose pose) Alter the ragdoll's pose using the locking body interface.voidsetPose(SkeletonPose pose, boolean lockBodies) Alter the ragdoll's pose.toRef()Create a counted reference to the nativeRagdoll.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
addToPhysicsSystem
Add bodies and constraints to the physics system and optionally activate the bodies.- Parameters:
activation- whether to activate bodies (notnull)
-
driveToPoseUsingKinematics
Drive the ragdoll to the specified pose by setting velocities.- Parameters:
pose- the desired posetime- time to achieve the pose (in seconds)
-
driveToPoseUsingKinematics
Drive the ragdoll to the specified pose by setting velocities.- Parameters:
pose- the desired posetime- time to achieve the pose (in seconds)lockBodies- (default=true)
-
driveToPoseUsingMotors
Drive the ragdoll to the specified pose using motors.- Parameters:
pose- the desired pose (notnull, 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 function: 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
Copy the low-level pose using a locking body interface.- Parameters:
storeRootOffset- storage for the root offset (notnull, modified)storeJointMatrices- storage for the joint matrices (notnull, modified)
-
getPose
Copy the low-level pose.- Parameters:
storeRootOffset- storage for the root offset (notnull, modified)storeJointMatrices- storage for the joint matrices (notnull, modified)lockBodies-true→ use the locking body interface,false→ use the non-locking body interface (default=true)
-
getPose
Copy the ragdoll's pose using the locking body interface.- Parameters:
storePose- storage for the pose (notnull, modified)
-
getPose
Copy the ragdoll's pose.- Parameters:
storePose- storage for the pose (notnull, modified)lockBodies- true→use the locking body interface, false→use the non-locking body interface
-
getRootTransform
Copy the transform of the ragdoll's root, using the locking body interface. The ragdoll is unaffected.- Parameters:
storeLocation- storage for the root location (notnull, modified)storeOrientation- storage for the root orientation (notnull, modified)
-
getRootTransform
Copy the transform of the ragdoll's root. The ragdoll is unaffected.- Parameters:
storeLocation- storage for the root location (notnull, modified)storeOrientation- storage for the root orientation (notnull, 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
Alter the ragdoll's pose using the locking body interface.- Parameters:
pose- the desired pose (notnull, unaffected)
-
setPose
Alter the ragdoll's pose.- Parameters:
pose- the desired pose (notnull, 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 nativeRagdoll. The ragdoll is unaffected.- Specified by:
getRefCountin interfaceRefTarget- Returns:
- the count (≥0)
-
setEmbedded
public void setEmbedded()Mark the nativeRagdollas embedded.- Specified by:
setEmbeddedin interfaceRefTarget
-
toRef
Create a counted reference to the nativeRagdoll.
-