Overload  1.1
Game engine with editor
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
OvCore::ECS::Components::CPhysicalObject Class Reference

#include <CPhysicalObject.h>

Inheritance diagram for OvCore::ECS::Components::CPhysicalObject:
OvCore::ECS::Components::AComponent OvCore::API::IInspectorItem OvCore::API::ISerializable OvCore::ECS::Components::CPhysicalBox OvCore::ECS::Components::CPhysicalCapsule OvCore::ECS::Components::CPhysicalSphere

Public Member Functions

 CPhysicalObject (ECS::Actor &p_owner)
 
void AddForce (const OvMaths::FVector3 &p_force)
 
void AddImpulse (const OvMaths::FVector3 &p_impulse)
 
void ClearForces ()
 
float GetMass () const
 
OvPhysics::Entities::PhysicalObject::ECollisionDetectionMode GetCollisionDetectionMode () const
 
float GetBounciness () const
 
float GetFriction () const
 
OvMaths::FVector3 GetLinearVelocity () const
 
OvMaths::FVector3 GetAngularVelocity () const
 
OvMaths::FVector3 GetLinearFactor () const
 
OvMaths::FVector3 GetAngularFactor () const
 
bool IsTrigger () const
 
bool IsKinematic () const
 
OvPhysics::Entities::PhysicalObject::EActivationState GetActivationState () const
 
void SetMass (float p_mass)
 
void SetCollisionDetectionMode (OvPhysics::Entities::PhysicalObject::ECollisionDetectionMode p_mode)
 
void SetBounciness (float p_bounciness)
 
void SetFriction (float p_friction)
 
void SetLinearVelocity (const OvMaths::FVector3 &p_linearVelocity)
 
void SetAngularVelocity (const OvMaths::FVector3 &p_angularVelocity)
 
void SetLinearFactor (const OvMaths::FVector3 &p_linearFactor)
 
void SetAngularFactor (const OvMaths::FVector3 &p_angularFactor)
 
void SetTrigger (bool p_trigger)
 
void SetKinematic (bool p_kinematic)
 
void SetActivationState (OvPhysics::Entities::PhysicalObject::EActivationState p_activationState)
 
virtual void OnSerialize (tinyxml2::XMLDocument &p_doc, tinyxml2::XMLNode *p_node) override
 
virtual void OnDeserialize (tinyxml2::XMLDocument &p_doc, tinyxml2::XMLNode *p_node) override
 
virtual void OnInspector (OvUI::Internal::WidgetContainer &p_root) override
 
- Public Member Functions inherited from OvCore::ECS::Components::AComponent
 AComponent (ECS::Actor &p_owner)
 
virtual ~AComponent ()
 
virtual void OnAwake ()
 
virtual void OnStart ()
 
virtual void OnDestroy ()
 
virtual void OnUpdate (float p_deltaTime)
 
virtual void OnFixedUpdate (float p_deltaTime)
 
virtual void OnLateUpdate (float p_deltaTime)
 
virtual void OnCollisionEnter (Components::CPhysicalObject &p_otherObject)
 
virtual void OnCollisionStay (Components::CPhysicalObject &p_otherObject)
 
virtual void OnCollisionExit (Components::CPhysicalObject &p_otherObject)
 
virtual void OnTriggerEnter (Components::CPhysicalObject &p_otherObject)
 
virtual void OnTriggerStay (Components::CPhysicalObject &p_otherObject)
 
virtual void OnTriggerExit (Components::CPhysicalObject &p_otherObject)
 
virtual std::string GetName ()=0
 

Public Attributes

OvTools::Eventing::Event< CPhysicalObject & > CollisionEnterEvent
 
OvTools::Eventing::Event< CPhysicalObject & > CollisionStayEvent
 
OvTools::Eventing::Event< CPhysicalObject & > CollisionExitEvent
 
OvTools::Eventing::Event< CPhysicalObject & > TriggerEnterEvent
 
OvTools::Eventing::Event< CPhysicalObject & > TriggerStayEvent
 
OvTools::Eventing::Event< CPhysicalObject & > TriggerExitEvent
 
- Public Attributes inherited from OvCore::ECS::Components::AComponent
ECS::Actorowner
 

Protected Member Functions

template<typename T >
T & GetPhysicalObjectAs () const
 
void Init ()
 
void BindListener ()
 

Protected Attributes

std::unique_ptr< OvPhysics::Entities::PhysicalObjectm_physicalObject
 

Detailed Description

Base class for any physical object

Constructor & Destructor Documentation

◆ CPhysicalObject()

OvCore::ECS::Components::CPhysicalObject::CPhysicalObject ( ECS::Actor p_owner)

Constructor

Parameters
p_owner@project: Overload
Author
: Overload Tech. @restrictions: This software may not be resold, redistributed or otherwise conveyed to a third party.

Member Function Documentation

◆ AddForce()

void OvCore::ECS::Components::CPhysicalObject::AddForce ( const OvMaths::FVector3 p_force)

Add a force to the rigidbody

Parameters
p_force

◆ AddImpulse()

void OvCore::ECS::Components::CPhysicalObject::AddImpulse ( const OvMaths::FVector3 p_impulse)

Add an impulse to the rigidbody

Parameters
p_impulse

◆ BindListener()

void OvCore::ECS::Components::CPhysicalObject::BindListener ( )
protected

◆ ClearForces()

void OvCore::ECS::Components::CPhysicalObject::ClearForces ( )

Clear forces

◆ GetActivationState()

OvPhysics::Entities::PhysicalObject::EActivationState OvCore::ECS::Components::CPhysicalObject::GetActivationState ( ) const

Returns the current activation state

◆ GetAngularFactor()

OvMaths::FVector3 OvCore::ECS::Components::CPhysicalObject::GetAngularFactor ( ) const

Returns the angular factor of the physical object

◆ GetAngularVelocity()

OvMaths::FVector3 OvCore::ECS::Components::CPhysicalObject::GetAngularVelocity ( ) const

Returns the angular of the physical object

◆ GetBounciness()

float OvCore::ECS::Components::CPhysicalObject::GetBounciness ( ) const

Returns the bounciness of the physical object

◆ GetCollisionDetectionMode()

OvPhysics::Entities::PhysicalObject::ECollisionDetectionMode OvCore::ECS::Components::CPhysicalObject::GetCollisionDetectionMode ( ) const

Returns the collision detection mode of the physical object

◆ GetFriction()

float OvCore::ECS::Components::CPhysicalObject::GetFriction ( ) const

Returns the friction of the physical object

◆ GetLinearFactor()

OvMaths::FVector3 OvCore::ECS::Components::CPhysicalObject::GetLinearFactor ( ) const

Returns the linear factor of the physical object

◆ GetLinearVelocity()

OvMaths::FVector3 OvCore::ECS::Components::CPhysicalObject::GetLinearVelocity ( ) const

Returns the linear velocity of the physical object

◆ GetMass()

float OvCore::ECS::Components::CPhysicalObject::GetMass ( ) const

Returns the mass of the physical object

◆ GetPhysicalObjectAs()

template<typename T >
T& OvCore::ECS::Components::CPhysicalObject::GetPhysicalObjectAs ( ) const
inlineprotected

◆ Init()

void OvCore::ECS::Components::CPhysicalObject::Init ( )
protected

◆ IsKinematic()

bool OvCore::ECS::Components::CPhysicalObject::IsKinematic ( ) const

Returns true if the physical object is kinematic

◆ IsTrigger()

bool OvCore::ECS::Components::CPhysicalObject::IsTrigger ( ) const

Returns true if the physical object is a trigger

◆ OnDeserialize()

void OvCore::ECS::Components::CPhysicalObject::OnDeserialize ( tinyxml2::XMLDocument &  p_doc,
tinyxml2::XMLNode *  p_node 
)
overridevirtual

◆ OnInspector()

void OvCore::ECS::Components::CPhysicalObject::OnInspector ( OvUI::Internal::WidgetContainer p_root)
overridevirtual

Defines how the component should be drawn in the inspector

Parameters
p_root

Implements OvCore::API::IInspectorItem.

Reimplemented in OvCore::ECS::Components::CPhysicalCapsule, OvCore::ECS::Components::CPhysicalBox, and OvCore::ECS::Components::CPhysicalSphere.

◆ OnSerialize()

void OvCore::ECS::Components::CPhysicalObject::OnSerialize ( tinyxml2::XMLDocument &  p_doc,
tinyxml2::XMLNode *  p_node 
)
overridevirtual

◆ SetActivationState()

void OvCore::ECS::Components::CPhysicalObject::SetActivationState ( OvPhysics::Entities::PhysicalObject::EActivationState  p_activationState)

Defines the new activation state for the physical object

Parameters
p_activationState

◆ SetAngularFactor()

void OvCore::ECS::Components::CPhysicalObject::SetAngularFactor ( const OvMaths::FVector3 p_angularFactor)

Defines a new angular factor for the physical object

Parameters
p_angularFactor

◆ SetAngularVelocity()

void OvCore::ECS::Components::CPhysicalObject::SetAngularVelocity ( const OvMaths::FVector3 p_angularVelocity)

Defines a new angular velocity for the physical object

Parameters
p_angularVelocity

◆ SetBounciness()

void OvCore::ECS::Components::CPhysicalObject::SetBounciness ( float  p_bounciness)

Defines a new bounciness for the physical object

Parameters
p_bounciness

◆ SetCollisionDetectionMode()

void OvCore::ECS::Components::CPhysicalObject::SetCollisionDetectionMode ( OvPhysics::Entities::PhysicalObject::ECollisionDetectionMode  p_mode)

Defines a new collision detection mode for the physical object

Parameters
p_mode

◆ SetFriction()

void OvCore::ECS::Components::CPhysicalObject::SetFriction ( float  p_friction)

Defines a new friction for the physical object

Parameters
p_mass

◆ SetKinematic()

void OvCore::ECS::Components::CPhysicalObject::SetKinematic ( bool  p_kinematic)

Defines if the physical object should be kinematic or not

Parameters
p_kinematic

◆ SetLinearFactor()

void OvCore::ECS::Components::CPhysicalObject::SetLinearFactor ( const OvMaths::FVector3 p_linearFactor)

Defines a new linear factor for the physical object

Parameters
p_linearFactor

◆ SetLinearVelocity()

void OvCore::ECS::Components::CPhysicalObject::SetLinearVelocity ( const OvMaths::FVector3 p_linearVelocity)

Defines a new linear velocity for the physical object

Parameters
p_linearVelocity

◆ SetMass()

void OvCore::ECS::Components::CPhysicalObject::SetMass ( float  p_mass)

Defines a new mass for the physical object

Parameters
p_mass

◆ SetTrigger()

void OvCore::ECS::Components::CPhysicalObject::SetTrigger ( bool  p_trigger)

Defines if the physical object should be a trigger or not

Parameters
p_trigger

Member Data Documentation

◆ CollisionEnterEvent

OvTools::Eventing::Event<CPhysicalObject&> OvCore::ECS::Components::CPhysicalObject::CollisionEnterEvent

◆ CollisionExitEvent

OvTools::Eventing::Event<CPhysicalObject&> OvCore::ECS::Components::CPhysicalObject::CollisionExitEvent

◆ CollisionStayEvent

OvTools::Eventing::Event<CPhysicalObject&> OvCore::ECS::Components::CPhysicalObject::CollisionStayEvent

◆ m_physicalObject

std::unique_ptr<OvPhysics::Entities::PhysicalObject> OvCore::ECS::Components::CPhysicalObject::m_physicalObject
protected

◆ TriggerEnterEvent

OvTools::Eventing::Event<CPhysicalObject&> OvCore::ECS::Components::CPhysicalObject::TriggerEnterEvent

◆ TriggerExitEvent

OvTools::Eventing::Event<CPhysicalObject&> OvCore::ECS::Components::CPhysicalObject::TriggerExitEvent

◆ TriggerStayEvent

OvTools::Eventing::Event<CPhysicalObject&> OvCore::ECS::Components::CPhysicalObject::TriggerStayEvent

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