My Project
Loading...
Searching...
No Matches
Engine::Scene Class Reference

Represents a scene containing multiple GameObjects. Manages creation, destruction, and updating of root GameObjects. More...

#include <Scene.hpp>

Public Member Functions

 Scene ()=default
 ~Scene ()
GameObjectCreateGameObject ()
 Creates a new GameObject and adds it to the rootObjects list.
void DestroyGameObject (GameObject *go)
 Destroys a GameObject and removes it from the scene.
void Update (float dt)
 Updates all root GameObjects and their children recursively.
const std::vector< GameObject * > & GetRootObjects () const
 Returns a reference to the root GameObjects of the scene.

Detailed Description

Represents a scene containing multiple GameObjects. Manages creation, destruction, and updating of root GameObjects.

Constructor & Destructor Documentation

◆ Scene()

Engine::Scene::Scene ( )
default

◆ ~Scene()

Engine::Scene::~Scene ( )

Member Function Documentation

◆ CreateGameObject()

GameObject * Engine::Scene::CreateGameObject ( )

Creates a new GameObject and adds it to the rootObjects list.

Returns
Pointer to the newly created GameObject

◆ DestroyGameObject()

void Engine::Scene::DestroyGameObject ( GameObject * go)

Destroys a GameObject and removes it from the scene.

Parameters
goPointer to the GameObject to destroy

◆ GetRootObjects()

const std::vector< GameObject * > & Engine::Scene::GetRootObjects ( ) const

Returns a reference to the root GameObjects of the scene.

Returns
Const reference to the vector of root GameObjects

◆ Update()

void Engine::Scene::Update ( float dt)

Updates all root GameObjects and their children recursively.

Parameters
dtDelta time in seconds

The documentation for this class was generated from the following file: