Base class for all Simulated bodies in Physics.
More...
#include <PhysicsSimulatedBody.h>
Inherited by AzPhysics::RigidBody, AzPhysics::StaticRigidBody, Physics::Character, Physics::Ragdoll, and Physics::RagdollNode.
|
static void | Reflect (AZ::ReflectContext *context) |
|
|
| 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 constexpr uint32_t | UndefinedFrameId = AZStd::numeric_limits<uint32_t>::max() |
|
|
class | Automation::SimulatedBodyCollisionAutomationHandler |
|
class | Automation::SimulatedBodyTriggerAutomationHandler |
|
Base class for all Simulated bodies in Physics.
◆ GetFrameId()
uint32_t AzPhysics::SimulatedBody::GetFrameId |
( |
| ) |
const |
|
inline |
Helper functions for getting the set frame ID.
- Returns
- Will return the frame ID.
◆ GetScene()
virtual Scene* AzPhysics::SimulatedBody::GetScene |
( |
| ) |
|
|
virtual |
Helper to get the scene this body is attached too.
- Returns
- Returns a pointer to the scene.
◆ GetUserData()
void* AzPhysics::SimulatedBody::GetUserData |
( |
| ) |
|
|
inline |
Helper functions for getting the set user data.
- Returns
- Will return a void* to the user data set.
◆ ProcessCollisionEvent()
void AzPhysics::SimulatedBody::ProcessCollisionEvent |
( |
const CollisionEvent & |
collision | ) |
const |
Helper to direct the CollisionEvent to the correct handler. Will invoke the OnCollisionBegin or OnCollisionPersist or OnCollisionEnd event.
- Parameters
-
collision | The collision data to be routed. |
◆ ProcessTriggerEvent()
void AzPhysics::SimulatedBody::ProcessTriggerEvent |
( |
const TriggerEvent & |
trigger | ) |
const |
Helper to direct the TriggerEvent to the correct handler. Will invoke the OnTriggerEnter or OnTriggerExitevent event.
- Parameters
-
trigger | The trigger data to be routed. |
◆ RayCast()
Perform a ray cast on this Simulated Body.
- Parameters
-
request | The request to make. |
- Returns
- Returns the closest hit, if any, against this simulated body.
◆ RegisterOnCollisionBeginHandler()
void AzPhysics::SimulatedBody::RegisterOnCollisionBeginHandler |
( |
SimulatedBodyEvents::OnCollisionBegin::Handler & |
handler | ) |
|
|
inline |
Helpers to register a handler for Collision events on this Simulated body. OnCollisionBegin is when two bodies start to collide. OnCollisionPersist is when two bodies continue to collide. OnCollisionEnd is when two bodies stop colliding.
◆ RegisterOnTriggerEnterHandler()
void AzPhysics::SimulatedBody::RegisterOnTriggerEnterHandler |
( |
SimulatedBodyEvents::OnTriggerEnter::Handler & |
handler | ) |
|
|
inline |
Helpers to register a handler for Trigger Events on this Simulated body. OnTriggerEnter is when a body enters a trigger. OnTriggerExit is when a body leaves a trigger.
◆ SetFrameId()
void AzPhysics::SimulatedBody::SetFrameId |
( |
uint32_t |
frameId | ) |
|
|
inline |
Helper functions for setting frame ID.
- Parameters
-
frameId | Optionally set frame ID for the systems moving the actors back in time. |
◆ SetUserData()
template<typename T >
void AzPhysics::SimulatedBody::SetUserData |
( |
T * |
userData | ) |
|
Helper functions for setting user data.
- Parameters
-
userData | Can be a pointer to any type as internally will be cast to a void*. Object lifetime not managed by the SimulatedBody. |
◆ SyncTransform()
void AzPhysics::SimulatedBody::SyncTransform |
( |
float |
deltaTime | ) |
const |
Helper to send SyncTransform event to the relevant handlers.
- Parameters
-
◆ m_simulating
bool AzPhysics::SimulatedBody::m_simulating = false |
Flag to determine if the body is part of the simulation. When true the body will be affected by any forces, collisions, and found with scene queries.
The documentation for this struct was generated from the following file:
- Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.h