RavEngine
Loading...
Searching...
No Matches
RavEngine::RigidBodyDynamicComponent Class Reference
Inheritance diagram for RavEngine::RigidBodyDynamicComponent:
[legend]
Collaboration diagram for RavEngine::RigidBodyDynamicComponent:
[legend]

Public Types

enum  AxisLock {
  Linear_X = (1 << 0) , Linear_Y = (1 << 1) , Linear_Z = (1 << 2) , Angular_X = (1 << 3) ,
  Angular_Y = (1 << 4) , Angular_Z = (1 << 5)
}
 
- Public Types inherited from RavEngine::Queryable< types >
typedef std::array< ctti_t, ntypes > arraytype
 
- Public Types inherited from RavEngine::QueryableDelta< PhysicsBodyComponent, RigidBodyDynamicComponent >
typedef std::array< ctti_t, ntypes > arraytype
 

Public Member Functions

 RigidBodyDynamicComponent (Entity owner)
 Dynamic Body ========================================.
 
 RigidBodyDynamicComponent (Entity owner, physx::PxU32 fg, physx::PxU32 fm)
 
vector3 GetLinearVelocity () const
 
vector3 GetAngularVelocity () const
 
void SetLinearVelocity (const vector3 &, bool)
 
void SetAngularVelocity (const vector3 &, bool)
 
void SetKinematicTarget (const vector3 &targetPos, const quaternion &targetRot)
 
std::pair< vector3, quaternion > GetKinematicTarget () const
 
void Wake ()
 
void Sleep ()
 
bool IsSleeping () const
 
void SetAxisLock (uint16_t LockFlags)
 
uint16_t GetAxisLock () const
 
void SetMass (decimalType mass)
 
decimalType GetMass () const
 
decimalType GetMassInverse () const
 
void AddForce (const vector3 &force)
 
void AddTorque (const vector3 &torque)
 
void ClearAllForces ()
 
void ClearAllTorques ()
 
void Destroy ()
 
- Public Member Functions inherited from RavEngine::PhysicsBodyComponent
auto getScene () const
 
 PhysicsBodyComponent (Entity owner)
 
void Destroy ()
 
template<typename T , typename ... A>
ColliderHandle EmplaceCollider (A &&... args)
 
template<typename T >
void DestroyCollider (ColliderHandle handle)
 
void OnDestroyDetatchCollider (RavEngine::PhysicsCollider &collider)
 
void AddReceiver (decltype(receivers)::value_type &obj)
 
void RemoveReceiver (decltype(receivers)::value_type &obj)
 
void RemoveReceiver (PhysicsCallback *)
 
std::pair< vector3, quaternion > getDynamicsWorldPose () const
 
void setDynamicsWorldPose (const vector3 &worldpos, const quaternion &worldrot) const
 
void SetGravityEnabled (bool)
 
bool GetGravityEnabled () const
 
void SetSleepNotificationsEnabled (bool)
 
bool GetSleepNotificationsEnabled () const
 
void SetSimulationEnabled (bool)
 
bool GetSimulationEnabled () const
 
void OnColliderEnter (PhysicsBodyComponent &other, const ContactPairPoint *contactPoints, size_t numContactPoints)
 
void OnColliderPersist (PhysicsBodyComponent &other, const ContactPairPoint *contactPoints, size_t numContactPoints)
 
void OnColliderExit (PhysicsBodyComponent &other, const ContactPairPoint *contactPoints, size_t numContactPoints)
 
void OnTriggerEnter (PhysicsBodyComponent &other)
 
void OnTriggerExit (PhysicsBodyComponent &other)
 
bool GetWantsContactData () const
 
void SetWantsContactData (bool state)
 
void DebugDraw (RavEngine::DebugDrawer &dbg, const RavEngine::Transform &tr) const
 
- Public Member Functions inherited from RavEngine::ComponentWithOwner
 ComponentWithOwner (const decltype(owner) o)
 
Entity GetOwner () const
 

Additional Inherited Members

- Static Public Member Functions inherited from RavEngine::Queryable< types >
static constexpr const arraytype & GetQueryTypes ()
 
- Static Public Member Functions inherited from RavEngine::QueryableDelta< PhysicsBodyComponent, RigidBodyDynamicComponent >
static constexpr const arraytype & GetQueryTypes ()
 
- Public Attributes inherited from RavEngine::PhysicsBodyComponent
physx::PxRigidActor * rigidActor = nullptr
 
physx::PxU32 filterGroup = -1
 
physx::PxU32 filterMask = -1
 
- Public Attributes inherited from RavEngine::IDebugRenderable
bool debugEnabled = false
 
color_t debug_color = 0xFFFFFFFF
 
- Public Attributes inherited from RavEngine::Queryable< types >
constexpr q_qt_def
 
- Public Attributes inherited from RavEngine::QueryableDelta< PhysicsBodyComponent, RigidBodyDynamicComponent >
constexpr qb_qt_def
 
- Static Public Attributes inherited from RavEngine::Queryable< types >
static constexpr std::size_t ntypes = sizeof ... (types)
 
- Static Public Attributes inherited from RavEngine::QueryableDelta< PhysicsBodyComponent, RigidBodyDynamicComponent >
static constexpr std::size_t ntypes
 
- Protected Member Functions inherited from RavEngine::PhysicsBodyComponent
void CompleteConstruction ()
 
template<typename T >
void LockWrite (const T &func)
 
template<typename T >
void LockRead (const T &func) const
 
- Protected Attributes inherited from RavEngine::PhysicsBodyComponent
UnorderedSet< std::shared_ptr< PhysicsCallback > > receivers
 
Colony< std::shared_ptr< PhysicsCollider > > colliders
 
bool setPoseNeedsSync = false
 
bool wantsContactData = false
 
- Protected Attributes inherited from RavEngine::ComponentWithOwner
Entity owner
 

Member Function Documentation

◆ AddForce()

void RigidBodyDynamicComponent::AddForce ( const vector3 &  force)

Add a force to the object

Parameters
forcethe vector representing the force

◆ AddTorque()

void RigidBodyDynamicComponent::AddTorque ( const vector3 &  torque)

Add a torque to the object

Parameters
torquethe vector representing the torque

◆ ClearAllForces()

void RigidBodyDynamicComponent::ClearAllForces ( )

Reset all active forces on the object

◆ ClearAllTorques()

void RigidBodyDynamicComponent::ClearAllTorques ( )

Reset all active torques on the object

◆ GetAngularVelocity()

vector3 RavEngine::RigidBodyDynamicComponent::GetAngularVelocity ( ) const
Returns
the current body's angular velocity in euler angles

◆ GetAxisLock()

uint16_t RavEngine::RigidBodyDynamicComponent::GetAxisLock ( ) const
Returns
the currently-active locking flags
See also
AxisLock enum

◆ GetLinearVelocity()

vector3 RavEngine::RigidBodyDynamicComponent::GetLinearVelocity ( ) const
Returns
the body's current linear velocity

◆ GetMass()

decimalType RigidBodyDynamicComponent::GetMass ( ) const
Returns
the mass of the body

◆ GetMassInverse()

decimalType RigidBodyDynamicComponent::GetMassInverse ( ) const
Returns
the inverse mass of the body

◆ IsSleeping()

bool RavEngine::RigidBodyDynamicComponent::IsSleeping ( ) const
Returns
true if the body is asleep.

◆ SetAngularVelocity()

void RavEngine::RigidBodyDynamicComponent::SetAngularVelocity ( const vector3 &  newvel,
bool  autowake 
)

Set the angular velocity of the physics body

Parameters
newvelthe new velocity for each euler axis
autowakewhether to automatically wake this physics body to apply the change. If set to false, the body must be woken manually.

◆ SetAxisLock()

void RavEngine::RigidBodyDynamicComponent::SetAxisLock ( uint16_t  LockFlags)

Set the axis locking flags.

See also
AxisLock enum.
Parameters
LockFlagsa bitmask representing the axes to lock or unlock

◆ SetLinearVelocity()

void RavEngine::RigidBodyDynamicComponent::SetLinearVelocity ( const vector3 &  newvel,
bool  autowake 
)

Set the linear velocity of the physics body

Parameters
newvelthe new velocity for each axis
autowakewhether to automatically wake this physics body to apply the change. If set to false, the body must be woken manually.

◆ SetMass()

void RigidBodyDynamicComponent::SetMass ( decimalType  mass)

Set the mass of this physics body

Parameters
massthe mass of the body

◆ Sleep()

void RavEngine::RigidBodyDynamicComponent::Sleep ( )

Put the body to sleep

◆ Wake()

void RavEngine::RigidBodyDynamicComponent::Wake ( )

Wake the body


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