103 Array<
int> mBodyIndexToConstraintIndex;
122 void AddToPhysicsSystem(
EActivation inActivationMode,
bool inLockBodies =
true);
125 void RemoveFromPhysicsSystem(
bool inLockBodies =
true);
128 void Activate(
bool inLockBodies =
true);
134 void SetPose(
const SkeletonPose &inPose,
bool inLockBodies =
true);
137 void SetPose(
RVec3Arg inRootOffset,
const Mat44 *inJointMatrices,
bool inLockBodies =
true);
140 void GetPose(
SkeletonPose &outPose,
bool inLockBodies =
true);
143 void GetPose(
RVec3 &outRootOffset,
Mat44 *outJointMatrices,
bool inLockBodies =
true);
146 void DriveToPoseUsingKinematics(
const SkeletonPose &inPose,
float inDeltaTime,
bool inLockBodies =
true);
149 void DriveToPoseUsingKinematics(
RVec3Arg inRootOffset,
const Mat44 *inJointMatrices,
float inDeltaTime,
bool inLockBodies =
true);
152 void DriveToPoseUsingMotors(
const SkeletonPose &inPose);
155 void SetLinearAndAngularVelocity(
Vec3Arg inLinearVelocity,
Vec3Arg inAngularVelocity,
bool inLockBodies =
true);
158 void SetLinearVelocity(
Vec3Arg inLinearVelocity,
bool inLockBodies =
true);
161 void AddLinearVelocity(
Vec3Arg inLinearVelocity,
bool inLockBodies =
true);
164 void AddImpulse(
Vec3Arg inImpulse,
bool inLockBodies =
true);
167 void GetRootTransform(
RVec3 &outPosition,
Quat &outRotation,
bool inLockBodies =
true)
const;
188 AABox GetWorldSpaceBounds(
bool inLockBodies =
true)
const;
#define JPH_NAMESPACE_END
Definition Core.h:240
uint64_t uint64
Definition Core.h:313
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
EActivation
Enum used by AddBody to determine if the body needs to be initially active.
Definition EActivation.h:11
@ Activate
Activate the body, making it part of the simulation.
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
#define JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(class_name)
Definition SerializableObject.h:71
Axis aligned box.
Definition AABox.h:16
Settings for constructing a rigid body.
Definition BodyCreationSettings.h:29
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
uint32 GroupID
Definition CollisionGroup.h:24
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
Definition PhysicsSystem.h:28
Runtime ragdoll information.
Definition Ragdoll.h:111
const TwoBodyConstraint * GetConstraint(int inConstraintIndex) const
Access a constraint by index.
Definition Ragdoll.h:185
size_t GetConstraintCount() const
Get number of constraints in the ragdoll.
Definition Ragdoll.h:179
size_t GetBodyCount() const
Get number of bodies in the ragdoll.
Definition Ragdoll.h:170
TwoBodyConstraint * GetConstraint(int inConstraintIndex)
Access a constraint by index.
Definition Ragdoll.h:182
const Array< BodyID > & GetBodyIDs() const
Access to the array of body IDs.
Definition Ragdoll.h:176
JPH_OVERRIDE_NEW_DELETE Ragdoll(PhysicsSystem *inSystem)
Constructor.
Definition Ragdoll.h:116
BodyID GetBodyID(int inBodyIndex) const
Access a body ID.
Definition Ragdoll.h:173
const RagdollSettings * GetRagdollSettings() const
Get the settings object that created this ragdoll.
Definition Ragdoll.h:191
A single rigid body sub part of the ragdoll.
Definition Ragdoll.h:85
Ref< TwoBodyConstraintSettings > mToParent
Definition Ragdoll.h:89
Contains the structure of a ragdoll.
Definition Ragdoll.h:22
const Array< int > & GetBodyIndexToConstraintIndex() const
Get table that maps a body index to the constraint index with which it is connected to its parent....
Definition Ragdoll.h:67
Skeleton * GetSkeleton()
Definition Ragdoll.h:61
int GetConstraintIndexForBodyIndex(int inBodyIndex) const
Map a single body index to a constraint index.
Definition Ragdoll.h:70
void CalculateBodyIndexToConstraintIndex()
Calculate the map needed for GetBodyIndexToConstraintIndex()
Definition Ragdoll.cpp:379
static RagdollResult sRestoreFromBinaryState(StreamIn &inStream)
Restore a saved ragdoll from inStream.
Definition Ragdoll.cpp:275
pair< int, int > BodyIdxPair
Definition Ragdoll.h:75
void DisableParentChildCollisions(const Mat44 *inJointMatrices=nullptr, float inMinSeparationDistance=0.0f)
Definition Ragdoll.cpp:185
void CalculateConstraintIndexToBodyIdxPair()
Calculate the map needed for GetConstraintIndexToBodyIdxPair()
Definition Ragdoll.cpp:394
void SaveBinaryState(StreamOut &inStream, bool inSaveShapes, bool inSaveGroupFilter) const
Definition Ragdoll.cpp:252
const Skeleton * GetSkeleton() const
Access to the skeleton of this ragdoll.
Definition Ragdoll.h:60
Ragdoll * CreateRagdoll(CollisionGroup::GroupID inCollisionGroup, uint64 inUserData, PhysicsSystem *inSystem) const
Definition Ragdoll.cpp:338
const Array< BodyIdxPair > & GetConstraintIndexToBodyIdxPair() const
Table that maps a constraint index (index in mConstraints) to the indices of the bodies that the cons...
Definition Ragdoll.h:78
bool Stabilize()
Definition Ragdoll.cpp:44
BodyIdxPair GetBodyIndicesForConstraintIndex(int inConstraintIndex) const
Map a single constraint index (index in mConstraints) to the indices of the bodies that the constrain...
Definition Ragdoll.h:81
PartVector mParts
For each of the joints, the body and constraint attaching it to its parent body (1-on-1 with mSkeleto...
Definition Ragdoll.h:99
Ref< Skeleton > mSkeleton
The skeleton for this ragdoll.
Definition Ragdoll.h:96
Array< Part > PartVector
List of ragdoll parts.
Definition Ragdoll.h:93
Definition Reference.h:154
Definition Reference.h:101
Definition Reference.h:35
Helper class that either contains a valid result or an error.
Definition Result.h:15
Resource that contains the joint hierarchy for a skeleton.
Definition Skeleton.h:18
Instance of a skeleton, contains the pose the current skeleton is in.
Definition SkeletonPose.h:18
Simple binary input stream.
Definition StreamIn.h:11
Simple binary output stream.
Definition StreamOut.h:11
Base class for all constraints that involve 2 bodies. Body1 is usually considered the parent,...
Definition TwoBodyConstraint.h:27
Base class for settings for all constraints that involve 2 bodies.
Definition TwoBodyConstraint.h:16