9#include <glm/ext/matrix_float4x4.hpp>
10#include <glm/ext/vector_float3.hpp>
14#define EE_INVALID_ENTITY_ID UINT32_MAX
21 class ComponentRegistry;
31 GameObject(std::string name, std::shared_ptr<Scene> scene, std::shared_ptr<GameObject> parent =
nullptr);
34 template<
typename T,
typename... Args>
48 inline std::string&
GetName() {
return m_name; }
49 inline void SetName(std::string newName) { m_name = newName; }
51 void SetParent(std::shared_ptr<GameObject> newParent);
54 void RemoveChild(std::shared_ptr<GameObject> child);
59 inline const bool HasChild()
const {
return m_childs.size() > 0; }
60 inline std::set<std::shared_ptr<GameObject>>
GetChilds()
const {
return m_childs; }
62 static std::shared_ptr<GameObject>
Create(std::string name, std::shared_ptr<Scene> scene, std::shared_ptr<GameObject> parent =
nullptr);
85 void AddChild(std::shared_ptr<GameObject> child);
94 std::shared_ptr<GameObject> m_parent;
95 std::set<std::shared_ptr<GameObject>> m_childs;
101 static uint32_t s_goIdCount;
102 bool m_isInitialized =
false;
#define EE_INVALID_ENTITY_ID
static std::shared_ptr< GameObject > Create(std::string name, std::shared_ptr< Scene > scene, std::shared_ptr< GameObject > parent=nullptr)
void OnSetRotation() override
T & AddComponent(Args &&... args)
void Notify(Event &event)
void RemoveChild(std::shared_ptr< GameObject > child)
T * GetComponent(bool onlyReturnActive=false)
void SetName(std::string newName)
glm::mat4 GenGlobalMatrix() const
void RenderWhenSelected()
void OnSetPosition() override
glm::vec3 GetGlobalPosition()
void OnSetScale() override
void SetParent(std::shared_ptr< GameObject > newParent)
void SetFromGlobalMatrix(const glm::mat4 &newWorld)
const bool HasChild() const
friend class Editor::EditorLayer
void AddChild(std::shared_ptr< GameObject > child)
std::vector< Component * > GetComponents()
std::set< std::shared_ptr< GameObject > > GetChilds() const