Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
EngineCore::Scene Class Reference

A scene is the overarching structure which can spawn actors. More...

#include <Scene.h>

Inheritance diagram for EngineCore::Scene:
Collaboration diagram for EngineCore::Scene:

Public Member Functions

 Scene ()
virtual ~Scene ()
template<typename T, typename... Args>
T * spawnActor (const Ecs::LocalTransform &spawnTransform, Args &&... args)
 Spawns an actor from a specific class in somewhere into the scene.
void destroyActor (Actor *actor)
virtual void loadContent ()
virtual void unloadContent ()
std::vector< Entity * > getEntities () const
void cleanup ()
SceneManagergetSceneManager () const
AssetManagergetAssetManager () const
 Gets the asset manager for this scene.
void setAssetManager (AssetManager *manager)
 Sets the asset manager for this scene (used for dependency injection in tests)
EnginegetEngine () const
 Gets the engine instance for this scene.
Public Member Functions inherited from EngineCore::ITickable
virtual ~ITickable ()=default
virtual void preTick ()
 Function which executes immediately before the execution of ITickable::preTick()
virtual void tick (double deltaTimeSeconds)
 Function called each frame when a tick component has been registered with EnTT Ecs::Tick.
virtual void postTick ()
 Function which executes immediately after the execution of ITickable::postTick()

Protected Attributes

Engineengine = nullptr
AssetManagerassetManager = nullptr

Private Attributes

std::unique_ptr< SceneGraphsceneGraph
std::vector< Entity * > entities

Detailed Description

A scene is the overarching structure which can spawn actors.

Definition at line 17 of file Scene.h.

Constructor & Destructor Documentation

◆ Scene()

EngineCore::Scene::Scene ( )

Definition at line 8 of file Scene.cpp.

References assetManager, engine, EngineCore::EngineManager::getEngineModule(), EngineCore::EngineManager::getInstance(), and sceneGraph.

Here is the call graph for this function:

◆ ~Scene()

EngineCore::Scene::~Scene ( )
virtualdefault

Member Function Documentation

◆ cleanup()

void EngineCore::Scene::cleanup ( )

Definition at line 40 of file Scene.cpp.

References entities, and getEntities().

Here is the call graph for this function:

◆ destroyActor()

void EngineCore::Scene::destroyActor ( Actor * actor)

Definition at line 16 of file Scene.cpp.

References EngineCore::Actor::endPlay().

Here is the call graph for this function:

◆ getAssetManager()

AssetManager * EngineCore::Scene::getAssetManager ( ) const
nodiscard

Gets the asset manager for this scene.

Returns
Pointer to the AssetManager, or nullptr if not set

Definition at line 53 of file Scene.cpp.

References assetManager.

Referenced by EngineCore::MeshComponent::MeshComponent(), and EngineCore::GltfSpawner::spawnAll().

Here is the caller graph for this function:

◆ getEngine()

Engine * EngineCore::Scene::getEngine ( ) const
inlinenodiscard

Gets the engine instance for this scene.

Returns
Pointer to the Engine, or nullptr if not set

Definition at line 81 of file Scene.h.

References engine.

◆ getEntities()

std::vector< Entity * > EngineCore::Scene::getEntities ( ) const
nodiscard

Definition at line 31 of file Scene.cpp.

References entities.

Referenced by cleanup().

Here is the caller graph for this function:

◆ getSceneManager()

SceneManager * EngineCore::Scene::getSceneManager ( ) const
nodiscard

Definition at line 49 of file Scene.cpp.

References engine.

◆ loadContent()

void EngineCore::Scene::loadContent ( )
virtual

Definition at line 24 of file Scene.cpp.

◆ setAssetManager()

void EngineCore::Scene::setAssetManager ( AssetManager * manager)

Sets the asset manager for this scene (used for dependency injection in tests)

Parameters
managerPointer to the AssetManager

Definition at line 57 of file Scene.cpp.

References assetManager.

◆ spawnActor()

template<typename T, typename... Args>
T * EngineCore::Scene::spawnActor ( const Ecs::LocalTransform & spawnTransform,
Args &&... args )
inline

Spawns an actor from a specific class in somewhere into the scene.

Parameters
spawnTransformwhere the actor should be placed into the world
argsArguments
Returns
The spawned actor in the provided class
Template Parameters
ArgsArguments

Definition at line 33 of file Scene.h.

References entities, sceneGraph, and TRACY_ZONE_SCOPED_NAMED.

Referenced by EngineCore::GltfSpawner::spawnAll().

Here is the caller graph for this function:

◆ unloadContent()

void EngineCore::Scene::unloadContent ( )
virtual

Definition at line 27 of file Scene.cpp.

References TRACY_ZONE_SCOPED_NAMED.

Member Data Documentation

◆ assetManager

AssetManager* EngineCore::Scene::assetManager = nullptr
protected

Definition at line 85 of file Scene.h.

Referenced by getAssetManager(), Scene(), and setAssetManager().

◆ engine

Engine* EngineCore::Scene::engine = nullptr
protected

Definition at line 84 of file Scene.h.

Referenced by getEngine(), getSceneManager(), and Scene().

◆ entities

std::vector<Entity*> EngineCore::Scene::entities
private

Definition at line 90 of file Scene.h.

Referenced by cleanup(), getEntities(), and spawnActor().

◆ sceneGraph

std::unique_ptr<SceneGraph> EngineCore::Scene::sceneGraph
private

Definition at line 88 of file Scene.h.

Referenced by Scene(), and spawnActor().


The documentation for this class was generated from the following files:
  • /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/Entity/Scene.h
  • /home/magerbeton/Documents/gl3-vulkan/Engine/src/Engine/Entity/Scene.cpp