Package com.github.stephengold.joltjni
Class Ragdoll
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<ConstJoltPhysicsObject>
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.voidDrive the ragdoll to the specified pose using motors.intCount the active references to the nativeRagdoll.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, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
Method Details
-
addToPhysicsSystem
Add bodies and constraints to the physics system and optionally activate the bodies.- Parameters:
activation- whether to activate bodies (not null)
-
driveToPoseUsingMotors
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
Alter the ragdoll's pose using the locking body interface.- Parameters:
pose- the desired pose (not null, unaffected)
-
setPose
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 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.
-