class
GameObject
GameObject wraps an Entity with metadata (name, tag, layer, active state). Every GameObject always has a TransformComponent. This provides a Unity-style OOP API on top of the ECS.
- Module
- Game
- Header
#include "Scene/GameObject.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
GameObject() = default | GameObject | |
GameObject(Entity entity, Scene* scene) | GameObject |
Public functions
| Returns | Name | Description |
|---|---|---|
EntityID | GetID | Core identity |
Entity | GetEntity | |
Scene* | GetScene | |
bool | IsValid | |
const std::string& | GetName | Name |
void | SetName | |
const std::string& | GetTag | Tag |
void | SetTag | |
uint32_t | GetLayer | Layer (0-31) |
void | SetLayer | |
bool | IsActive | Active state (synced with Scene::EntityInfo) |
void | SetActive | |
bool | IsActiveInHierarchy | |
TransformComponent* | GetTransform | Transform (always present on GameObjects created via CreateGameObject) |
void | RefreshTransformCache | Refresh cached transform pointer (call after adding TransformComponent externally) |
T& | AddComponent | Component operations (delegated to Entity) |
void | RemoveComponent | |
T* | GetComponent | |
const T* | GetComponent | |
bool | HasComponent | |
GameObject* | GetParent | Hierarchy |
std::vector<GameObject*> | GetChildren | |
void | SetParent | |
void | RemoveParent | |
bool | operator== | Comparison |
bool | operator!= |
Function details
GameObject
C++
GameObject() = defaultGameObject
C++
GameObject(Entity entity, Scene* scene)GetID
C++
EntityID GetID() constCore identity
GetEntity
C++
Entity GetEntity() constGetScene
C++
Scene* GetScene() constIsValid
C++
bool IsValid() constGetName
C++
const std::string& GetName() constName
SetName
C++
void SetName(const std::string& name)GetTag
C++
const std::string& GetTag() constTag
SetTag
C++
void SetTag(const std::string& tag)GetLayer
C++
uint32_t GetLayer() constLayer (0-31)
SetLayer
C++
void SetLayer(uint32_t layer)IsActive
C++
bool IsActive() constActive state (synced with Scene::EntityInfo)
SetActive
C++
void SetActive(bool active)IsActiveInHierarchy
C++
bool IsActiveInHierarchy() constGetTransform
C++
TransformComponent* GetTransform() constTransform (always present on GameObjects created via CreateGameObject)
RefreshTransformCache
C++
void RefreshTransformCache()Refresh cached transform pointer (call after adding TransformComponent externally)
AddComponent
C++
template<typename T, typename... Args> T& AddComponent(Args&&... args)Component operations (delegated to Entity)
RemoveComponent
C++
template<typename T> void RemoveComponent()GetComponent
C++
template<typename T> T* GetComponent()GetComponent
C++
template<typename T> const T* GetComponent() constHasComponent
C++
template<typename T> bool HasComponent() constGetParent
C++
GameObject* GetParent() constHierarchy
GetChildren
C++
std::vector<GameObject*> GetChildren() constSetParent
C++
void SetParent(GameObject* parent)RemoveParent
C++
void RemoveParent()operator==
C++
bool operator==(const GameObject& other) constComparison
operator!=
C++
bool operator!=(const GameObject& other) constGenerated from Scene/GameObject.h via game.json · Nov 5, 2026Version 1.0.0