|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
A scene is the overarching structure which can spawn, contain and destroy actors or entities. More...
#include <Scene.h>
Public Member Functions | |
| Scene () | |
| ~Scene () override | |
| template<typename T, typename... Args> | |
| T * | spawnActor (const Ecs::Transform &spawnTransform, Args &&... args) |
| Spawns an actor from a specific class in somewhere into the scene. | |
| void | destroyActor (Entities::Actor *actor) |
| virtual void | loadContent () |
| virtual void | unloadContent () |
| std::vector< Entities::Entity * > | getEntities () const |
| void | reserveActorCapacity (size_t additionalActors) |
| Reserves storage for a known number of upcoming actor spawns. | |
| void | cleanup () |
| Core::SceneManager * | getSceneManager () const |
| Core::AssetManager * | getAssetManager () const |
| Gets the asset manager for this scene. | |
| void | setAssetManager (Core::AssetManager *manager) |
| Sets the asset manager for this scene (used for dependency injection in tests) | |
| EngineKern * | getEngine () const |
| Gets the engine instance for this scene. | |
| SceneGraph * | getSceneGraph () const |
| Public Member Functions inherited from Engine::Core::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() | |
Static Public Member Functions | |
| template<typename ActorT = StaticMeshActor> | |
| static std::vector< ActorT * > | spawnAll (Scene *scene, const std::filesystem::path &gltfPath) |
| Spawns all meshes from a GLTF file into the scene. | |
Protected Attributes | |
| EngineKern * | engine_ = nullptr |
| Core::AssetManager * | assetManager = nullptr |
Private Attributes | |
| std::unique_ptr< SceneGraph > | sceneGraph |
| std::vector< Entity * > | entities |
A scene is the overarching structure which can spawn, contain and destroy actors or entities.
| Engine::Entities::Scene::Scene | ( | ) |
|
override |
| void Engine::Entities::Scene::cleanup | ( | ) |
| void Engine::Entities::Scene::destroyActor | ( | Entities::Actor * | actor | ) |
|
nodiscard |
Gets the asset manager for this scene.
|
inlinenodiscard |
|
nodiscard |
|
inlinenodiscard |
Definition at line 156 of file Scene.h.
References sceneGraph.
|
nodiscard |
|
virtual |
| void Engine::Entities::Scene::reserveActorCapacity | ( | size_t | additionalActors | ) |
Reserves storage for a known number of upcoming actor spawns.
| void Engine::Entities::Scene::setAssetManager | ( | Core::AssetManager * | manager | ) |
Sets the asset manager for this scene (used for dependency injection in tests)
| manager | Pointer to the AssetManager |
|
inline |
Spawns an actor from a specific class in somewhere into the scene.
| spawnTransform | where the actor should be placed into the world |
| args | Arguments |
| Args | Arguments |
Definition at line 72 of file Scene.h.
References entities, sceneGraph, and TRACY_ZONE_SCOPED_NAMED.
Referenced by spawnAll().
|
inlinestatic |
Spawns all meshes from a GLTF file into the scene.
Each mesh in the GLTF file becomes a separate actor of type ActorT, positioned using the transform from the GLTF file.
| ActorT | Actor type to spawn (default: StaticMeshActor) |
| scene | The scene to spawn actors into |
| gltfPath | Path to the GLTF/GLB file |
Definition at line 106 of file Scene.h.
References Engine::Entities::detail::applyGltfNodeExtensions(), Engine::Entities::detail::GltfSpawnPlan::meshNodes, Engine::Entities::detail::GltfSpawnNode::meshPath, Engine::Entities::detail::prepareGltfSpawnPlan(), Scene(), spawnActor(), and Engine::Entities::detail::GltfSpawnNode::transform.
Referenced by Engine::Entities::GltfSpawner::spawnAll().
|
virtual |
|
protected |
|
protected |
Definition at line 159 of file Scene.h.
Referenced by getEngine().
|
private |
Definition at line 165 of file Scene.h.
Referenced by spawnActor().
|
private |
Definition at line 163 of file Scene.h.
Referenced by getSceneGraph(), and spawnActor().