//
// Generated by Brutal.Jolt.Generate; do not edit by hand.
#nullable enable
using Brutal.Interop;
using Brutal.Numerics;
namespace Brutal.JoltApi
{
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:136
///
/// class Ragdoll : public RefTarget<Ragdoll>, public NonCopyable
///
///
///
///
/// Runtime ragdoll information
///
///
[InteropHandle]
public readonly partial struct Ragdoll : IDisposable
{
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:142
///
/// explicit Ragdoll(PhysicsSystem *inSystem)
///
///
///
///
/// Constructor
///
///
public static Ragdoll Create(PhysicsSystem system) => Jolt.PInvoke.Ragdoll_Create(system);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:148
///
/// void AddToPhysicsSystem(EActivation inActivationMode, bool inLockBodies = true)
///
///
///
///
/// Add bodies and constraints to the system and optionally activate the bodies
///
///
public void AddToPhysicsSystem(EActivation activationMode, bool lockBodies) => Jolt.PInvoke.Ragdoll_AddToPhysicsSystem(this, activationMode, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:151
///
/// void RemoveFromPhysicsSystem(bool inLockBodies = true)
///
///
///
///
/// Remove bodies and constraints from the system
///
///
public void RemoveFromPhysicsSystem(bool lockBodies) => Jolt.PInvoke.Ragdoll_RemoveFromPhysicsSystem(this, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:154
///
/// void Activate(bool inLockBodies = true)
///
///
///
///
/// Wake up all bodies in the ragdoll
///
///
public void Activate(bool lockBodies) => Jolt.PInvoke.Ragdoll_Activate(this, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:160
///
/// bool IsActive(bool inLockBodies = true) const
///
///
///
///
/// Check if one or more of the bodies in the ragdoll are active.
/// Note that this involves locking the bodies (if inLockBodies is true) and looping over them. An alternative and possibly faster
/// way could be to install a BodyActivationListener and count the number of active bodies of a ragdoll as they're activated / deactivated
/// (basically check if the body that activates / deactivates is in GetBodyIDs() and increment / decrement a counter).
///
///
public bool IsActive(bool lockBodies) => Jolt.PInvoke.Ragdoll_IsActive(this, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:163
///
/// void SetGroupID(CollisionGroup::GroupID inGroupID, bool inLockBodies = true)
///
///
///
///
/// Set the group ID on all bodies in the ragdoll
///
///
public void SetGroupID(uint groupID, bool lockBodies) => Jolt.PInvoke.Ragdoll_SetGroupID(this, groupID, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:166
///
/// void SetPose(const SkeletonPose &inPose, bool inLockBodies = true)
///
///
///
///
/// Set the ragdoll to a pose (calls BodyInterface::SetPositionAndRotation to instantly move the ragdoll)
///
///
public void SetPose(SkeletonPose pose, bool lockBodies) => Jolt.PInvoke.Ragdoll_SetPose(this, pose, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:172
///
/// void GetPose(SkeletonPose &outPose, bool inLockBodies = true)
///
///
///
///
/// Get the ragdoll pose (uses the world transform of the bodies to calculate the pose)
///
///
public void GetPose(SkeletonPose pose, bool lockBodies) => Jolt.PInvoke.Ragdoll_GetPose(this, pose, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:178
///
/// void ResetWarmStart()
///
///
///
///
/// This function calls ResetWarmStart on all constraints. It can be used after calling SetPose to reset
/// previous frames impulses. See: Constraint::ResetWarmStart.
///
///
public void ResetWarmStart() => Jolt.PInvoke.Ragdoll_ResetWarmStart(this);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:181
///
/// void DriveToPoseUsingKinematics(const SkeletonPose &inPose, float inDeltaTime, bool inLockBodies = true)
///
///
///
///
/// Drive the ragdoll to a specific pose by setting velocities on each of the bodies so that it will reach
/// inPose in inDeltaTime
///
///
public void DriveToPoseUsingKinematics(SkeletonPose pose, float deltaTime, bool lockBodies) => Jolt.PInvoke.Ragdoll_DriveToPoseUsingKinematics(this, pose, deltaTime, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:187
///
/// void DriveToPoseUsingMotors(const SkeletonPose &inPose)
///
///
///
///
/// Drive the ragdoll to a specific pose by activating the motors on each constraint
///
///
public void DriveToPoseUsingMotors(SkeletonPose pose) => Jolt.PInvoke.Ragdoll_DriveToPoseUsingMotors(this, pose);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:190
///
/// void SetLinearAndAngularVelocity(Vec3Arg inLinearVelocity, Vec3Arg inAngularVelocity, bool inLockBodies = true)
///
///
///
///
/// Control the linear and velocity of all bodies in the ragdoll
///
///
public void SetLinearAndAngularVelocity(float3 linearVelocity, float3 angularVelocity, bool lockBodies) => Jolt.PInvoke.Ragdoll_SetLinearAndAngularVelocity(this, linearVelocity, angularVelocity, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:193
///
/// void SetLinearVelocity(Vec3Arg inLinearVelocity, bool inLockBodies = true)
///
///
///
///
/// Set the world space linear velocity of all bodies in the ragdoll.
///
///
public void SetLinearVelocity(float3 linearVelocity, bool lockBodies) => Jolt.PInvoke.Ragdoll_SetLinearVelocity(this, linearVelocity, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:196
///
/// void AddLinearVelocity(Vec3Arg inLinearVelocity, bool inLockBodies = true)
///
///
///
///
/// Add a world space velocity (in m/s) to all bodies in the ragdoll.
///
///
public void AddLinearVelocity(float3 linearVelocity, bool lockBodies) => Jolt.PInvoke.Ragdoll_AddLinearVelocity(this, linearVelocity, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:199
///
/// void AddImpulse(Vec3Arg inImpulse, bool inLockBodies = true)
///
///
///
///
/// Add impulse to all bodies of the ragdoll (center of mass of each of them)
///
///
public void AddImpulse(float3 impulse, bool lockBodies) => Jolt.PInvoke.Ragdoll_AddImpulse(this, impulse, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:202
///
/// void GetRootTransform(RVec3 &outPosition, Quat &outRotation, bool inLockBodies = true) const
///
///
///
///
/// Get the position and orientation of the root of the ragdoll
///
///
public void GetRootTransform(out float3 position, out floatQuat rotation, bool lockBodies) => Jolt.PInvoke.Ragdoll_GetRootTransform(this, out position, out rotation, lockBodies);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:205
///
/// size_t GetBodyCount() const
///
///
///
///
/// Get number of bodies in the ragdoll
///
///
public ElementCount GetBodyCount() => (ElementCount)Jolt.PInvoke.Ragdoll_GetBodyCount(this);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:208
///
/// BodyID GetBodyID(int inBodyIndex) const
///
///
///
///
/// Access a body ID
///
///
public uint GetBodyID(int bodyIndex) => Jolt.PInvoke.Ragdoll_GetBodyID(this, bodyIndex);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:214
///
/// size_t GetConstraintCount() const
///
///
///
///
/// Get number of constraints in the ragdoll
///
///
public ElementCount GetConstraintCount() => (ElementCount)Jolt.PInvoke.Ragdoll_GetConstraintCount(this);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:217
///
/// TwoBodyConstraint * GetConstraint(int inConstraintIndex)
///
///
///
///
/// Access a constraint by index
///
///
public TwoBodyConstraint GetConstraint(int constraintIndex) => Jolt.PInvoke.Ragdoll_GetConstraint(this, constraintIndex);
///
///
/// C++:
/// Jolt/Physics/Ragdoll/Ragdoll.h:226
///
/// const RagdollSettings * GetRagdollSettings() const
///
///
///
///
/// Get the settings object that created this ragdoll
///
///
public RagdollSettings GetRagdollSettings() => Jolt.PInvoke.Ragdoll_GetRagdollSettings(this);
public void AddRef() => Jolt.PInvoke.Ragdoll_AddRef(this);
public void Release() => Jolt.PInvoke.Ragdoll_Release(this);
public uint GetRefCount() => Jolt.PInvoke.Ragdoll_GetRefCount(this);
public void Dispose()
{
if (IsNull()) return;
Release();
}
}
}