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

SignatureNameDescription
GameObject() = defaultGameObject
GameObject(Entity entity, Scene* scene)GameObject

Public functions

ReturnsNameDescription
EntityIDGetIDCore identity
EntityGetEntity
Scene*GetScene
boolIsValid
const std::string&GetNameName
voidSetName
const std::string&GetTagTag
voidSetTag
uint32_tGetLayerLayer (0-31)
voidSetLayer
boolIsActiveActive state (synced with Scene::EntityInfo)
voidSetActive
boolIsActiveInHierarchy
TransformComponent*GetTransformTransform (always present on GameObjects created via CreateGameObject)
voidRefreshTransformCacheRefresh cached transform pointer (call after adding TransformComponent externally)
T&AddComponentComponent operations (delegated to Entity)
voidRemoveComponent
T*GetComponent
const T*GetComponent
boolHasComponent
GameObject*GetParentHierarchy
std::vector<GameObject*>GetChildren
voidSetParent
voidRemoveParent
booloperator==Comparison
booloperator!=

Function details

GameObject

C++
GameObject() = default

GameObject

C++
GameObject(Entity entity, Scene* scene)

GetID

C++
EntityID GetID() const

Core identity

GetEntity

C++
Entity GetEntity() const

GetScene

C++
Scene* GetScene() const

IsValid

C++
bool IsValid() const

GetName

C++
const std::string& GetName() const

Name

SetName

C++
void SetName(const std::string& name)

GetTag

C++
const std::string& GetTag() const

Tag

SetTag

C++
void SetTag(const std::string& tag)

GetLayer

C++
uint32_t GetLayer() const

Layer (0-31)

SetLayer

C++
void SetLayer(uint32_t layer)

IsActive

C++
bool IsActive() const

Active state (synced with Scene::EntityInfo)

SetActive

C++
void SetActive(bool active)

IsActiveInHierarchy

C++
bool IsActiveInHierarchy() const

GetTransform

C++
TransformComponent* GetTransform() const

Transform (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() const

HasComponent

C++
template<typename T> bool HasComponent() const

GetParent

C++
GameObject* GetParent() const

Hierarchy

GetChildren

C++
std::vector<GameObject*> GetChildren() const

SetParent

C++
void SetParent(GameObject* parent)

RemoveParent

C++
void RemoveParent()

operator==

C++
bool operator==(const GameObject& other) const

Comparison

operator!=

C++
bool operator!=(const GameObject& other) const
Generated from Scene/GameObject.h via game.json · Nov 5, 2026Version 1.0.0