|
Clutter Engine 0.0.1
|
A template implementation of a Level in the Clutter Engine. More...
#include <TemplateLevel.h>
Public Member Functions | |
| TemplateLevel ()=default | |
| Default constructor for TemplateLevel. | |
| ~TemplateLevel ()=default | |
| Default destructor for TemplateLevel. | |
| void | Load () override |
| Loads the level resources and initializes the level. | |
| void | Update () override |
| Updates the level state. | |
| void | Close () override |
| Cleans up and closes the level. | |
Public Member Functions inherited from clt::Level | |
| Level (std::string pTitle="Scene") | |
| Constructs a new level with the given title. | |
| ~Level () | |
| Destroys the level and cleans up resources. | |
| void | SetManager (RendererGL *pRenderer, Physics *pPhysics, LevelManager *pManager) |
| Sets the renderer, physics, and manager for the level. | |
| void | OpenLevel (const std::string &pLevelName) |
| Opens a new level by name. | |
| bool | LineTrace (Vector3 start, Vector3 direction, float maxDistance, raycastHit &hit, bool debugPersistant=false, Actor *self=nullptr) |
| Performs a line trace (raycast) in the level. | |
| void | InternalUpdate () |
| Internal update function called by the engine. | |
| void | Unload () |
| Unloads the level and cleans up resources. | |
| template<typename T , typename... Args> | |
| T * | AddActor (Args &&... args) |
| Adds an actor of type T to the level. | |
| template<typename T > | |
| void | DestroyActor (Actor *pActor) |
| Removes an actor from the level. | |
| template<typename T > | |
| std::vector< T * > | GetAllActorOfType () |
| Gets all actors of a specific type. | |
| template<typename T > | |
| T * | GetActorOfType () |
| Gets the first actor of a specific type. | |
| RendererGL & | GetRenderer () const |
| Gets the renderer for the level. | |
| Physics & | GetPhysics () const |
| Gets the physics system for the level. | |
Additional Inherited Members | |
Public Attributes inherited from clt::Level | |
| friend | LevelManager |
Static Public Attributes inherited from clt::Level | |
| static Level * | ActiveScene |
| Pointer to the currently active scene. | |
Protected Member Functions inherited from clt::Level | |
Protected Attributes inherited from clt::Level | |
| std::string | mTitle |
| The title of the scene. | |
| RendererGL * | mRenderer |
| The renderer used for drawing the scene. | |
| Physics * | mPhysics |
| The physics system used in the level. | |
| LevelManager * | mManager |
| The manager responsible for this level. | |
| std::unordered_map< size_t, std::vector< Actor * > > | mActors |
| Map of actors categorized by their type. | |
| std::vector< Actor * > | mPendingActors |
| List of actors pending to be added to the level. | |
| std::vector< Actor * > | mDeadActors |
| List of actors pending to be removed from the level. | |
A template implementation of a Level in the Clutter Engine.
This class serves as a basic example or starting point for creating new levels.
|
inlineoverridevirtual |
Cleans up and closes the level.
Override this method to implement custom cleanup logic.
Implements clt::Level.
|
inlineoverridevirtual |
Loads the level resources and initializes the level.
Override this method to implement custom loading logic.
Implements clt::Level.
|
inlineoverridevirtual |
Updates the level state.
Override this method to implement custom update logic.
Implements clt::Level.