Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
eng::PhysicsComponent Class Referenceabstract

#include <PhysicsComponent.h>

+ Inheritance diagram for eng::PhysicsComponent:
+ Collaboration diagram for eng::PhysicsComponent:

Public Member Functions

 PhysicsComponent ()=default
 
 PhysicsComponent (const std::shared_ptr< RigidBody > &body)
 
void LoadProperties (const nlohmann::json &json) override
 
void Init () override
 
void Update (float deltaTime) override
 
void SetRigidBody (const std::shared_ptr< RigidBody > &body)
 
const std::shared_ptr< RigidBody > & GetRigidBody ()
 
virtual size_t GetTypeId () const =0
 
GameObjectGetOwner ()
 

Static Public Member Functions

template<typename T >
static size_t StaticTypeId ()
 

Protected Attributes

GameObjectm_owner = nullptr
 

Detailed Description

Definition at line 7 of file PhysicsComponent.h.

Constructor & Destructor Documentation

◆ PhysicsComponent() [1/2]

eng::PhysicsComponent::PhysicsComponent ( )
default

◆ PhysicsComponent() [2/2]

eng::PhysicsComponent::PhysicsComponent ( const std::shared_ptr< RigidBody > &  body)

Definition at line 7 of file PhysicsComponent.cpp.

Member Function Documentation

◆ GetOwner()

GameObject * eng::Component::GetOwner ( )
inherited

Definition at line 15 of file Component.cpp.

References eng::Component::m_owner.

Referenced by eng::MeshComponent::Update(), and eng::SpriteComponent::Update().

◆ GetRigidBody()

const std::shared_ptr< RigidBody > & eng::PhysicsComponent::GetRigidBody ( )

Definition at line 110 of file PhysicsComponent.cpp.

◆ GetTypeId()

virtual size_t eng::Component::GetTypeId ( ) const
pure virtualinherited

◆ Init()

◆ LoadProperties()

void eng::PhysicsComponent::LoadProperties ( const nlohmann::json &  json)
overridevirtual

Reimplemented from eng::Component.

Definition at line 12 of file PhysicsComponent.cpp.

References eng::Dynamic, eng::Kinematic, SetRigidBody(), and eng::Static.

◆ SetRigidBody()

void eng::PhysicsComponent::SetRigidBody ( const std::shared_ptr< RigidBody > &  body)

Definition at line 105 of file PhysicsComponent.cpp.

Referenced by LoadProperties().

◆ StaticTypeId()

template<typename T >
static size_t eng::Component::StaticTypeId ( )
inlinestaticinherited

Definition at line 26 of file Component.h.

◆ Update()

void eng::PhysicsComponent::Update ( float  deltaTime)
overridevirtual

Member Data Documentation

◆ m_owner


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