diff options
author | rtk0c <[email protected]> | 2022-04-08 22:30:12 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-04-08 22:30:12 -0700 |
commit | e7ef3f208c109357538b1f68af10bcd78db95c95 (patch) | |
tree | 066d614ae0f079e53602d7c0fd972998c546c8c1 /source/GameObject.hpp | |
parent | f163e8f37123e651ea80b690793845b31ddb8639 (diff) |
Changeset: 3 More work
Diffstat (limited to 'source/GameObject.hpp')
-rw-r--r-- | source/GameObject.hpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/source/GameObject.hpp b/source/GameObject.hpp index 9567edd..750ae4a 100644 --- a/source/GameObject.hpp +++ b/source/GameObject.hpp @@ -1,5 +1,6 @@ #pragma once +#include "EditorCoreAPI.hpp" #include "GameObjectTypeTag.hpp" #include "Material.hpp" #include "Mesh.hpp" @@ -11,12 +12,13 @@ class GameWorld; class GameObject { -private: - GameWorld* mWorld; - GameObject* mParent; +public: // NOTE: public for editors + std::unique_ptr<EditorGameObjectAttachment, EditorGameObjectAttachmentDeleter> mEditorAttachment = nullptr; + GameWorld* mWorld = nullptr; + GameObject* mParent = nullptr; PodVector<GameObject*> mChildren; - glm::quat mRot; - glm::vec3 mPos; + glm::quat mRot{}; + glm::vec3 mPos{}; public: static void FreeRecursive(GameObject* object); @@ -25,6 +27,11 @@ public: explicit GameObject(GameWorld* world); virtual ~GameObject(); + GameObject(const GameObject&) = delete; + GameObject& operator=(const GameObject&) = delete; + GameObject(GameObject&&) = default; + GameObject& operator=(GameObject&&) = default; + GameWorld* GetWorld() const; GameObject* GetParent() const; const PodVector<GameObject*>& GetChildren() const; @@ -33,13 +40,17 @@ public: GameObject* RemoveChild(GameObject* child); PodVector<GameObject*> RemoveAllChildren(); + EditorGameObjectAttachment* GetEditorAttachment() const { return mEditorAttachment.get(); } + void SetEditorAttachment(EditorGameObjectAttachment* attachment) { mEditorAttachment.reset(attachment); } + // Tag - virtual Tags::GameObjectMemoryManagement GetMemoryManagement() const; + virtual Tags::GameObjectMemoryManagement + GetMemoryManagement() const; virtual Tags::GameObjectType GetTypeTag() const; // Visuals virtual const Material* GetMeshMaterial() const; - virtual const Mesh* GetMesh() const; + virtual const GpuMesh* GetMesh() const; // Lifetime hooks virtual void Awaken(); |