java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Ref
com.github.stephengold.joltjni.RagdollRef
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A counted reference to a
Ragdoll
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToPhysicsSystem
(EActivation activation) Add bodies and constraints to the physics system and optionally activate the bodies.void
driveToPoseUsingKinematics
(SkeletonPose pose, float time) Drive the ragdoll to the specified pose by setting velocities.void
driveToPoseUsingKinematics
(SkeletonPose pose, float time, boolean lockBodies) Drive the ragdoll to the specified pose by setting velocities.void
Drive the ragdoll to the specified pose using motors.int
Count how many bodies are in the ragdoll, which is unaffectedint[]
Enumerate all bodies in the ragdoll, which is unaffected.int
Count how many constraints are in the ragdoll, which is unaffected.void
getPose
(RVec3 storeRootOffset, Mat44Array storeJointMatrices) Copy the low-level pose using a locking body interface.void
getPose
(RVec3 storeRootOffset, Mat44Array storeJointMatrices, boolean lockBodies) Copy the low-level pose.getPtr()
Temporarily access the referencedRagdoll
.void
getRootTransform
(RVec3 storeLocation, Quat storeOrientation) Copy the transform of the ragdoll's root, using the locking body interface.void
getRootTransform
(RVec3 storeLocation, Quat storeOrientation, boolean lockBodies) Copy the transform of the ragdoll's root.void
Remove bodies and constraints from the physics system.void
setPose
(SkeletonPose pose) Alter the ragdoll's pose using the locking body interface.void
setPose
(SkeletonPose pose, boolean lockBodies) Alter the ragdoll's pose.long
targetVa()
Return the address of the nativeRagdoll
.toRef()
Create another counted reference to the nativeRagdoll
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
RagdollRef
public RagdollRef()Instantiate an empty reference.
-
-
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 method: 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 (not null, modified)storeJointMatrices
- storage for the joint matrices (not null, modified)
-
getPose
Copy the low-level pose.- Parameters:
storeRootOffset
- storage for the root offset (not null, modified)storeJointMatrices
- storage for the joint matrices (not null, modified)lockBodies
-true
→ use the locking body interface,false
→ use the non-locking body interface (default=true)
-
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 (not null, modified)storeOrientation
- storage for the root orientation (not null, modified)
-
getRootTransform
Copy the transform of the ragdoll's root. The ragdoll is unaffected.- Parameters:
storeLocation
- storage for the root location (not null, modified)storeOrientation
- storage for the root orientation (not null, 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 (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
-
getPtr
Temporarily access the referencedRagdoll
. -
targetVa
public long targetVa()Return the address of the nativeRagdoll
. No objects are affected.- Specified by:
targetVa
in interfaceConstJoltPhysicsObject
- Overrides:
targetVa
in classJoltPhysicsObject
- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeRagdoll
.
-