Elevate Engine 1
Loading...
Searching...
No Matches
Elevate::Rigidbody Class Reference

#include <Rigidbody.h>

Inheritance diagram for Elevate::Rigidbody:
Elevate::Component EEObject

Public Member Functions

 BEGIN_COMPONENT (Rigidbody, EditorIcon(std::string(Editor::Icons::COMPONENT_ICON_RIGIDBODY))) Rigidbody()
 
 Rigidbody (const Rigidbody &other)
 
void Update () override
 
- Public Member Functions inherited from Elevate::Component
 Component ()=default
 
virtual ~Component ()=default
 
virtual ComponentClone ()=0
 
virtual void CopyFrom (Component *other)=0
 
virtual GameObjectComponentFactory GetFactory () const =0
 
virtual GameObjectComponentDestructor GetDestructor () const =0
 
virtual const void * GetEditorIconHandle () const
 
virtual std::type_index GetTypeIndex () const =0
 
void SetActive (bool newState)
 
bool IsActive ()
 
virtual ComponentLayout GetLayout () const
 
virtual bool RemoveFromGameObject ()
 
virtual std::string GetName () const
 
- Public Member Functions inherited from EEObject
virtual EECategory GetCategory () const
 

Additional Inherited Members

- Public Attributes inherited from Elevate::Component
std::function< bool()> RemoveFromGOFunc
 
GameObjectgameObject = nullptr
 
- Protected Member Functions inherited from Elevate::Component
virtual void Init ()
 
virtual void Destroy ()
 
virtual void Render ()
 
virtual void RenderInEditor ()
 
virtual void RenderWhenSelected ()
 
virtual void OnSetPosition ()
 
virtual void OnSetRotation ()
 
virtual void OnSetScale ()
 
virtual void OnNotify (Event &event)
 
- Protected Attributes inherited from Elevate::Component
bool m_IsActive = true
 
- Protected Attributes inherited from EEObject
EECategory m_category
 

Detailed Description

Definition at line 47 of file Rigidbody.h.

Constructor & Destructor Documentation

◆ Rigidbody()

Elevate::Rigidbody::Rigidbody ( const Rigidbody other)

Definition at line 9 of file Rigidbody.cpp.

10 {
11 }

Member Function Documentation

◆ BEGIN_COMPONENT()

Elevate::Rigidbody::BEGIN_COMPONENT ( Rigidbody  ,
EditorIcon(std::string(Editor::Icons::COMPONENT_ICON_RIGIDBODY))   
)

◆ Update()

void Elevate::Rigidbody::Update ( )
overridevirtual

Reimplemented from Elevate::Component.

Definition at line 18 of file Rigidbody.cpp.

19 {
20 m_data.m_force = m_data.m_gravity * m_data.m_mass;
21 m_data.m_velocity = m_data.m_velocity + m_data.m_force / m_data.m_mass * Time::GetDeltaTime();
22 glm::vec3 pos = gameObject->GetPosition() + m_data.m_velocity * Time::GetDeltaTime();
24 }
GameObject * gameObject
Definition Component.h:73
void SetPosition(glm::vec3 pos)
static float GetDeltaTime()
Definition Time.h:12

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