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.
AzPhysics::RigidBody Struct Referenceabstract

Dynamic rigid body. More...

#include <RigidBody.h>

Inherits AzPhysics::SimulatedBody.

Public Member Functions

 AZ_RTTI (AzPhysics::RigidBody, "{156E459F-7BB7-4B4E-ADA0-2130D96B7E80}", AzPhysics::SimulatedBody)
 
virtual void AddShape (AZStd::shared_ptr< Physics::Shape > shape)=0
 
virtual void RemoveShape (AZStd::shared_ptr< Physics::Shape > shape)=0
 
virtual AZ::u32 GetShapeCount () const
 
virtual AZStd::shared_ptr< Physics::ShapeGetShape (AZ::u32 index)
 
virtual AZStd::shared_ptr< const Physics::ShapeGetShape (AZ::u32 index) const
 
virtual AZ::Vector3 GetCenterOfMassWorld () const =0
 
virtual AZ::Vector3 GetCenterOfMassLocal () const =0
 
virtual AZ::Matrix3x3 GetInertiaWorld () const =0
 
virtual AZ::Matrix3x3 GetInertiaLocal () const =0
 
virtual AZ::Matrix3x3 GetInverseInertiaWorld () const =0
 
virtual AZ::Matrix3x3 GetInverseInertiaLocal () const =0
 
virtual float GetMass () const =0
 
virtual float GetInverseMass () const =0
 
virtual void SetMass (float mass)=0
 
virtual void SetCenterOfMassOffset (const AZ::Vector3 &comOffset)=0
 
virtual AZ::Vector3 GetLinearVelocity () const =0
 Retrieves the velocity at center of mass; only linear velocity, no rotational velocity contribution.
 
virtual void SetLinearVelocity (const AZ::Vector3 &velocity)=0
 
virtual AZ::Vector3 GetAngularVelocity () const =0
 
virtual void SetAngularVelocity (const AZ::Vector3 &angularVelocity)=0
 
virtual AZ::Vector3 GetLinearVelocityAtWorldPoint (const AZ::Vector3 &worldPoint) const =0
 
virtual void ApplyLinearImpulse (const AZ::Vector3 &impulse)=0
 
virtual void ApplyLinearImpulseAtWorldPoint (const AZ::Vector3 &impulse, const AZ::Vector3 &worldPoint)=0
 
virtual void ApplyAngularImpulse (const AZ::Vector3 &angularImpulse)=0
 
virtual float GetLinearDamping () const =0
 
virtual void SetLinearDamping (float damping)=0
 
virtual float GetAngularDamping () const =0
 
virtual void SetAngularDamping (float damping)=0
 
virtual bool IsAwake () const =0
 
virtual void ForceAsleep ()=0
 
virtual void ForceAwake ()=0
 
virtual float GetSleepThreshold () const =0
 
virtual void SetSleepThreshold (float threshold)=0
 
virtual bool IsKinematic () const =0
 
virtual void SetKinematic (bool kinematic)=0
 
virtual void SetKinematicTarget (const AZ::Transform &targetPosition)=0
 
virtual bool IsGravityEnabled () const =0
 
virtual void SetGravityEnabled (bool enabled)=0
 
virtual void SetSimulationEnabled (bool enabled)=0
 
virtual void SetCCDEnabled (bool enabled)=0
 
virtual void UpdateMassProperties (MassComputeFlags flags=MassComputeFlags::DEFAULT, const AZ::Vector3 &centerOfMassOffsetOverride=AZ::Vector3::CreateZero(), const AZ::Matrix3x3 &inertiaTensorOverride=AZ::Matrix3x3::CreateIdentity(), const float massOverride=1.0f)=0
 
- 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
 

Public Attributes

 AZ_CLASS_ALLOCATOR_DECL
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from AzPhysics::SimulatedBody
static void Reflect (AZ::ReflectContext *context)
 
- Static Public Attributes inherited from AzPhysics::SimulatedBody
static constexpr uint32_t UndefinedFrameId = AZStd::numeric_limits<uint32_t>::max()
 

Detailed Description

Dynamic rigid body.

Member Function Documentation

◆ UpdateMassProperties()

virtual void AzPhysics::RigidBody::UpdateMassProperties ( MassComputeFlags  flags = MassComputeFlags::DEFAULT,
const AZ::Vector3 &  centerOfMassOffsetOverride = AZ::Vector3::CreateZero(),
const AZ::Matrix3x3 &  inertiaTensorOverride = AZ::Matrix3x3::CreateIdentity(),
const float  massOverride = 1.0f 
)
pure virtual

Recalculates mass, inertia and center of mass based on the flags passed.

Parameters
flagsMassComputeFlags specifying which properties should be recomputed.
centerOfMassOffsetOverrideOptional override of the center of mass. Note: This parameter will be ignored if COMPUTE_COM is passed in flags.
inertiaTensorOverrideOptional override of the inertia. Note: This parameter will be ignored if COMPUTE_INERTIA is passed in flags.
massOverrideOptional override of the mass. Note: This parameter will be ignored if COMPUTE_MASS is passed in flags.

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