Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Physics::Ragdoll Class Referenceabstract

A hierarchical collection of rigid bodies connected by joints typically used to physically simulate a character. More...

#include <Ragdoll.h>

Inherits AzPhysics::SimulatedBody.

Public Member Functions

 AZ_CLASS_ALLOCATOR (Ragdoll, AZ::SystemAllocator)
 
 AZ_RTTI (Physics::Ragdoll, "{01F09602-80EC-4693-A0E7-C2719239044B}", AzPhysics::SimulatedBody)
 
virtual void EnableSimulation (const RagdollState &initialState)=0
 
virtual void EnableSimulationQueued (const RagdollState &initialState)=0
 
virtual void DisableSimulation ()=0
 Removes the ragdoll from physics simulation.
 
virtual void DisableSimulationQueued ()=0
 Queues removing the ragdoll from the physics simulation, to be executed before the next physics update.
 
virtual bool IsSimulated () const =0
 
virtual void GetState (RagdollState &ragdollState) const =0
 
virtual void SetState (const RagdollState &ragdollState)=0
 
virtual void SetStateQueued (const RagdollState &ragdollState)=0
 
virtual void GetNodeState (size_t nodeIndex, RagdollNodeState &nodeState) const =0
 
virtual void SetNodeState (size_t nodeIndex, const RagdollNodeState &nodeState)=0
 
virtual RagdollNodeGetNode (size_t nodeIndex) const =0
 
virtual size_t GetNumNodes () const =0
 Returns the number of ragdoll nodes in the ragdoll.
 
- Public Member Functions inherited from AzPhysics::SimulatedBody
 AZ_RTTI (AzPhysics::SimulatedBody, "{BCC37A4F-1C05-4660-9E41-0CCF2D5E7175}")
 
template<typename T >
void SetUserData (T *userData)
 
void * GetUserData ()
 
void SetFrameId (uint32_t frameId)
 
uint32_t GetFrameId () const
 
virtual AzPhysics::SceneQueryHit RayCast (const RayCastRequest &request)=0
 
void ProcessCollisionEvent (const CollisionEvent &collision) const
 
void ProcessTriggerEvent (const TriggerEvent &trigger) const
 
void SyncTransform (float deltaTime) const
 
void RegisterOnCollisionBeginHandler (SimulatedBodyEvents::OnCollisionBegin::Handler &handler)
 
void RegisterOnCollisionPersistHandler (SimulatedBodyEvents::OnCollisionPersist::Handler &handler)
 see RegisterOnCollisionBeginHandler
 
void RegisterOnCollisionEndHandler (SimulatedBodyEvents::OnCollisionEnd::Handler &handler)
 see RegisterOnCollisionBeginHandler
 
void RegisterOnTriggerEnterHandler (SimulatedBodyEvents::OnTriggerEnter::Handler &handler)
 
void RegisterOnTriggerExitHandler (SimulatedBodyEvents::OnTriggerExit::Handler &handler)
 see RegisterOnTriggerEnterHandler
 
void RegisterOnSyncTransformHandler (SimulatedBodyEvents::OnSyncTransform::Handler &handler)
 Helper to register a handler for a SyncTransform event on this Simulated body.
 
virtual AZ::Crc32 GetNativeType () const =0
 
virtual void * GetNativePointer () const =0
 
virtual SceneGetScene ()
 
virtual AZ::EntityId GetEntityId () const =0
 
virtual AZ::Transform GetTransform () const =0
 
virtual void SetTransform (const AZ::Transform &transform)=0
 
virtual AZ::Vector3 GetPosition () const =0
 
virtual AZ::Quaternion GetOrientation () const =0
 
virtual AZ::Aabb GetAabb () const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from AzPhysics::SimulatedBody
static void Reflect (AZ::ReflectContext *context)
 
- Public Attributes inherited from AzPhysics::SimulatedBody
 AZ_CLASS_ALLOCATOR_DECL
 
SceneHandle m_sceneOwner = AzPhysics::InvalidSceneHandle
 The current Scene the simulated body is contained.
 
SimulatedBodyHandle m_bodyHandle = AzPhysics::InvalidSimulatedBodyHandle
 The handle to this simulated body.
 
bool m_simulating = false
 
- Static Public Attributes inherited from AzPhysics::SimulatedBody
static constexpr uint32_t UndefinedFrameId = AZStd::numeric_limits<uint32_t>::max()
 

Detailed Description

A hierarchical collection of rigid bodies connected by joints typically used to physically simulate a character.

Member Function Documentation

◆ EnableSimulation()

virtual void Physics::Ragdoll::EnableSimulation ( const RagdollState &  initialState)
pure virtual

Inserts the ragdoll into the physics simulation.

Parameters
initialStateState for initializing the ragdoll positions, orientations and velocities.

◆ EnableSimulationQueued()

virtual void Physics::Ragdoll::EnableSimulationQueued ( const RagdollState &  initialState)
pure virtual

Queues inserting the ragdoll into the physics simulation, to be executed before the next physics update.

Parameters
initialStateState for initializing the ragdoll positions, orientations and velocities.

◆ GetNode()

virtual RagdollNode * Physics::Ragdoll::GetNode ( size_t  nodeIndex) const
pure virtual

Gets a pointer to an individual rigid body in the ragdoll.

Parameters
nodeIndexIndex in the physics representation of the character. Note this does not necessarily correspond to indices used in other systems.

◆ GetNodeState()

virtual void Physics::Ragdoll::GetNodeState ( size_t  nodeIndex,
RagdollNodeState nodeState 
) const
pure virtual

Writes the state for an individual body in the ragdoll to the provided output. The caller owns the output state and can safely manipulate it without affecting the physics simulation.

Parameters
nodeIndexIndex in the physics representation of the character. Note this does not necessarily correspond to indices used in other systems.
[out]nodeStateOutput parameter to write the node state to.

◆ GetState()

virtual void Physics::Ragdoll::GetState ( RagdollState &  ragdollState) const
pure virtual

Writes the state for all of the bodies in the ragdoll to the provided output. The caller owns the output state and can safely manipulate it without affecting the physics simulation.

Parameters
[out]ragdollStateOutput parameter to write ragdoll state to.

◆ IsSimulated()

virtual bool Physics::Ragdoll::IsSimulated ( ) const
pure virtual

Is the ragdoll currently simulated?

Returns
True in case the ragdoll is simulated, false if not.

◆ SetNodeState()

virtual void Physics::Ragdoll::SetNodeState ( size_t  nodeIndex,
const RagdollNodeState nodeState 
)
pure virtual

Updates the state for an individual body in the ragdoll using the input node state.

Parameters
nodeIndexIndex in the physics representation of the character. Note this does not necessarily correspond to indices used in other systems.
nodeStateContains the state with which to update the individual node.

◆ SetState()

virtual void Physics::Ragdoll::SetState ( const RagdollState &  ragdollState)
pure virtual

Updates the state for all of the bodies in the ragdoll using the input ragdoll state.

Parameters
ragdollStateThe state with which to update the ragdoll.

◆ SetStateQueued()

virtual void Physics::Ragdoll::SetStateQueued ( const RagdollState &  ragdollState)
pure virtual

Queues updating the state for all of the bodies in the ragdoll using the input ragdoll state. The new state is applied before the next physics update.

Parameters
ragdollStateThe state with which to update the ragdoll.

The documentation for this class was generated from the following file: