Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
GameObject.h File Reference

Scene node with a 3D transform and an attachable component list. More...

#include <memory>
#include <vector>
#include "Types.h"
#include "scene/Component.h"
+ Include dependency graph for GameObject.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mnd::ObjectCreatorBase
 
struct  mnd::ObjectCreator< T >
 
class  mnd::GameObjectFactory
 
class  mnd::GameObject
 Node in the scene graph: a named transform that owns components and children. More...
 

Namespaces

namespace  mnd
 

Macros

#define GAMEOBJECT(ObjectClass)
 

Detailed Description

Scene node with a 3D transform and an attachable component list.

Scene graph overview

GameObjects form a tree. Each node stores a local transform (position, rotation, scale) relative to its parent. World-space values are computed by concatenating transforms up to the root.

Scene
└── PlayerObject (has PlayerControllerComponent, CameraComponent)
└── GunObject (has MeshComponent, AnimationComponent)

Component lookup

Components are stored by pointer inside the object. Use GetComponent<T>() for typed access:

auto *cam = player->GetComponent<CameraComponent>();
if (cam) cam->DoSomething();

GLTF loading

LoadGLTF() creates a GameObject hierarchy that mirrors the node tree of a .glb/.gltf file, attaching MeshComponent and AnimationComponent as needed.

See also
Component, Scene, MeshComponent, CameraComponent

Definition in file GameObject.h.

Macro Definition Documentation

◆ GAMEOBJECT

#define GAMEOBJECT (   ObjectClass)
Value:
public: \
static void Register() \
{ \
mnd::GameObjectFactory::GetInstance().RegisterObject<ObjectClass>(std::string(#ObjectClass)); \
}

Definition at line 235 of file GameObject.h.