|
Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
|
A generic, data-driven scene implementation that loads its structure from a JSON file. More...
#include <DefaultScene.hpp>
Public Member Functions | |
| DefaultScene (Registry ®istry, VulkanRenderer &renderer, const std::string &jsonPath) | |
| Construct a new Default Scene. | |
| void | load () override |
| Loads the scene entities from JSON path if the file exists. | |
| void | update (float dt) override |
| Updates the scene simulation. Left empty as ECS systems handle state updates. | |
| Public Member Functions inherited from Scene | |
| Scene (Registry ®istry, VulkanRenderer &renderer) | |
| Construct a new Scene object. | |
| virtual | ~Scene () |
| Destroy the Scene object, unloading remaining entities. | |
| virtual void | unload () |
| Method called to clean up scene state and entities. | |
| virtual bool | saveToFile (const std::string &path) |
| Serializes scene entities to a JSON file. | |
| virtual bool | loadFromFile (const std::string &path) |
| Deserializes scene entities from a JSON file. | |
| virtual Entity | createPrimitiveEntity (const std::string &primitiveType) |
| Helper to spawn primitive geometric entities. | |
| virtual Entity | createEntityOfType (const std::string &entityType) |
| Helper to spawn complex predefined entities (Camera, Grid). | |
| virtual Entity | duplicateEntity (Entity entity) |
| Duplicates an existing entity. | |
| virtual bool | deleteEntity (Entity entity) |
| Destroys an entity and removes it from scene tracking. | |
| Entity | trackEntity (Entity entity) |
| Tracks an entity under scene ownership. | |
| void | untrackEntity (Entity entity) |
| Stops tracking an entity. | |
| std::string | makeUniqueEntityName (const std::string &baseName) const |
| Generates a unique name for an entity by appending indices if duplicate. | |
Private Attributes | |
| std::string | scenePath |
Additional Inherited Members | |
| Protected Member Functions inherited from Scene | |
| Entity | findEntityByName (const std::string &name) const |
| Locates an entity by its Name component. | |
| Protected Attributes inherited from Scene | |
| Registry & | registry |
| Reference to registry. | |
| VulkanRenderer & | renderer |
| Reference to Vulkan renderer. | |
A generic, data-driven scene implementation that loads its structure from a JSON file.
|
inline |
Construct a new Default Scene.
| registry | Reference to ECS registry. |
| renderer | Reference to Vulkan renderer. |
| jsonPath | Path to the scene JSON file. |
|
inlineoverridevirtual |
Loads the scene entities from JSON path if the file exists.
Implements Scene.
|
inlineoverridevirtual |
Updates the scene simulation. Left empty as ECS systems handle state updates.
| dt | Elapsed frame time. |
Implements Scene.
|
private |