![]() |
Raven Engine v0.1
|
Represents a scene containing entities and handles their lifecycle and rendering. More...
#include <Scene.h>
Public Member Functions | |
| Scene (SceneRenderer &renderer) | |
| Constructs a Scene instance linked to a specific SceneRenderer. | |
| ~Scene ()=default | |
| void | Shutdown () |
| Cleans up scene resources and entity-related data. | |
| Entity | CreateEntity (const std::string &name="") |
| Creates a new entity with an optional name. | |
| Entity | CreateEntityWithUUID (UUID uuid, const std::string &name) |
| Creates a new entity with a specified UUID and name. | |
| void | DestroyEntity (Entity entity) |
| Destroys the specified entity, removing it from the scene. | |
| void | OnUpdateEditor (Timestep ts) |
| Called every editor frame to update and render the scene. | |
| std::vector< Entity > | GetAllEntities () |
| Retrieves all entities currently in the scene. | |
| template<typename First, typename... Rest> | |
| std::vector< Entity > | GetAllEntitiesWith () |
| Retrieves all entities that have the specified component(s). | |
| template<typename T> | |
| void | OnComponentAdded (Entity entity, T &component) |
| template<> | |
| void | OnComponentAdded (Entity entity, TagComponent &component) |
| template<> | |
| void | OnComponentAdded (Entity entity, TransformComponent &component) |
| template<> | |
| void | OnComponentAdded (Entity entity, StaticMeshComponent &component) |
| template<> | |
| void | OnComponentAdded (Entity entity, PointLightComponent &component) |
| template<> | |
| void | OnComponentAdded (Entity entity, SkylightComponent &component) |
Represents a scene containing entities and handles their lifecycle and rendering.
Manages entity creation, destruction, and updates. Provides access to all entities, supports filtering entities by components, and integrates with the rendering system.
|
explicit |
Constructs a Scene instance linked to a specific SceneRenderer.
| renderer | Reference to the scene renderer used for rendering entities. |
|
default |
| Entity Raven::Scene::CreateEntity | ( | const std::string & | name = "" | ) |
Creates a new entity with an optional name.
| name | The optional name of the entity. Defaults to empty string. |
| void Raven::Scene::DestroyEntity | ( | Entity | entity | ) |
Destroys the specified entity, removing it from the scene.
| entity | The entity to destroy. |
|
inline |
Retrieves all entities currently in the scene.
|
inline |
Retrieves all entities that have the specified component(s).
| First | The first component type to filter by. |
| Rest | Additional component types to filter by. |
| void Raven::Scene::OnComponentAdded | ( | Entity | entity, |
| PointLightComponent & | component ) |
| void Raven::Scene::OnComponentAdded | ( | Entity | entity, |
| SkylightComponent & | component ) |
| void Raven::Scene::OnComponentAdded | ( | Entity | entity, |
| StaticMeshComponent & | component ) |
| void Raven::Scene::OnComponentAdded | ( | Entity | entity, |
| T & | component ) |
| void Raven::Scene::OnComponentAdded | ( | Entity | entity, |
| TagComponent & | component ) |
| void Raven::Scene::OnComponentAdded | ( | Entity | entity, |
| TransformComponent & | component ) |
| void Raven::Scene::OnUpdateEditor | ( | Timestep | ts | ) |
Called every editor frame to update and render the scene.
| ts | The timestep representing elapsed time since last update. |
| void Raven::Scene::Shutdown | ( | ) |
Cleans up scene resources and entity-related data.