Clutter Engine 0.0.1
Loading...
Searching...
No Matches
clt::TemplateLevel Class Reference

A template implementation of a Level in the Clutter Engine. More...

#include <TemplateLevel.h>

Inheritance diagram for clt::TemplateLevel:
clt::Level

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.
 
RendererGLGetRenderer () const
 Gets the renderer for the level.
 
PhysicsGetPhysics () 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 LevelActiveScene
 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.
 
RendererGLmRenderer
 The renderer used for drawing the scene.
 
PhysicsmPhysics
 The physics system used in the level.
 
LevelManagermManager
 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.
 

Detailed Description

A template implementation of a Level in the Clutter Engine.

This class serves as a basic example or starting point for creating new levels.

Member Function Documentation

◆ Close()

void clt::TemplateLevel::Close ( )
inlineoverridevirtual

Cleans up and closes the level.

Override this method to implement custom cleanup logic.

Implements clt::Level.

◆ Load()

void clt::TemplateLevel::Load ( )
inlineoverridevirtual

Loads the level resources and initializes the level.

Override this method to implement custom loading logic.

Implements clt::Level.

◆ Update()

void clt::TemplateLevel::Update ( )
inlineoverridevirtual

Updates the level state.

Override this method to implement custom update logic.

Implements clt::Level.


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