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 TypeMethodDescriptionvoidaddLinearVelocity(Vec3Arg deltaV) Add to the linear velocity of all bodies in the ragdoll.voidaddLinearVelocity(Vec3Arg deltaV, boolean lockBodies) Add to the linear velocity of all bodies in the ragdoll.voidaddToPhysicsSystem(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.getPtr()Temporarily access the referencedRagdoll.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.voidsetPose(SkeletonPose pose) Alter the ragdoll's pose using the locking body interface.voidsetPose(SkeletonPose pose, boolean lockBodies) Alter the ragdoll's pose.longtargetVa()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, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, toString, va
-
Constructor Details
-
RagdollRef
public RagdollRef()Instantiate an empty reference.
-
-
Method Details
-
addLinearVelocity
Add to the linear velocity of all bodies in the ragdoll.- Parameters:
deltaV- the desired change in velocity (meters per second in system coordinates, notnull, unaffected)
-
addLinearVelocity
Add to the linear velocity of all bodies in the ragdoll.- Parameters:
deltaV- the desired change in velocity (meters per second in system coordinates, notnull, unaffected)lockBodies- (default=true)
-
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- the time interval for achieving the pose (in seconds)
-
driveToPoseUsingKinematics
Drive the ragdoll to the specified pose by setting velocities.- Parameters:
pose- the desired posetime- the time interval for achieving 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
-
getPtr
Temporarily access the referencedRagdoll. -
targetVa
public long targetVa()Return the address of the nativeRagdoll. No objects are affected.- Specified by:
targetVain interfaceConstJoltPhysicsObject- Overrides:
targetVain classJoltPhysicsObject- Returns:
- a virtual address (not zero)
-
toRef
Create another counted reference to the nativeRagdoll.
-