|
Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
|
Factory functions to create, configure, and initialize typical entities and their Vulkan rendering resources. More...
Functions | |
| Entity | spawnPrimitive (Registry ®istry, VulkanRenderer &renderer, PrimitiveKind kind, const std::string &name, const glm::vec3 &position) |
| Spawns an entity with a basic geometric primitive mesh. | |
| Entity | spawnCamera (Registry ®istry, VulkanRenderer &renderer, const std::string &name, const glm::vec3 &position, const glm::vec3 &rotation, float fov) |
| Spawns a camera entity. | |
| Entity | spawnGrid (Registry ®istry, VulkanRenderer &renderer, const std::string &name, const glm::vec3 &position, const glm::vec3 &rotation, const glm::vec4 &color, float spacing, float size) |
| Spawns a grid entity used for rendering editor grids. | |
| Entity | spawnAnimatedModel (Registry ®istry, VulkanRenderer &renderer, const std::string &name, const std::string &gltfPath, const glm::vec3 &position) |
| Spawns an animated or static glTF mesh model. | |
| void | uploadMesh (Registry ®istry, VulkanRenderer &renderer, Entity entity) |
| Allocates and uploads GPU buffers for a mesh component on the specified entity. | |
Factory functions to create, configure, and initialize typical entities and their Vulkan rendering resources.
Factory methods for creating common game entities (cameras, grids, shapes) and uploading their mesh data.
| Entity EntityFactory::spawnAnimatedModel | ( | Registry & | registry, |
| VulkanRenderer & | renderer, | ||
| const std::string & | name, | ||
| const std::string & | gltfPath, | ||
| const glm::vec3 & | position ) |
Spawns an animated or static glTF mesh model.
| Entity EntityFactory::spawnCamera | ( | Registry & | registry, |
| VulkanRenderer & | renderer, | ||
| const std::string & | name, | ||
| const glm::vec3 & | position, | ||
| const glm::vec3 & | rotation, | ||
| float | fov ) |
Spawns a camera entity.
Spawns a camera entity with projection setup.
| registry | Reference to the ECS Registry. |
| renderer | Reference to the Vulkan Renderer. |
| name | Name of the camera entity. |
| position | Initial position of the camera. |
| rotation | Initial rotation of the camera. |
| fov | Field of view in degrees. |
| registry | Target ECS Registry. |
| renderer | Vulkan renderer context. |
| name | Camera name. |
| position | Location vector. |
| rotation | Yaw, pitch, roll orientation. |
| fov | Field of view. |
| Entity EntityFactory::spawnGrid | ( | Registry & | registry, |
| VulkanRenderer & | renderer, | ||
| const std::string & | name, | ||
| const glm::vec3 & | position, | ||
| const glm::vec3 & | rotation, | ||
| const glm::vec4 & | color, | ||
| float | spacing, | ||
| float | size ) |
Spawns a grid entity used for rendering editor grids.
Spawns a grid overlay drawing reference.
| registry | Reference to the ECS Registry. |
| renderer | Reference to the Vulkan Renderer. |
| name | Name of the grid entity. |
| position | Initial position of the grid. |
| rotation | Initial rotation of the grid. |
| color | Base color of grid lines. |
| spacing | Line spacing. |
| size | Overall grid size. |
| registry | Target ECS Registry. |
| renderer | Vulkan renderer context. |
| name | Grid name. |
| position | Location vector. |
| rotation | Orientation rotation. |
| color | Grid line color. |
| spacing | Line separation distance. |
| size | Overall grid area size. |
| Entity EntityFactory::spawnPrimitive | ( | Registry & | registry, |
| VulkanRenderer & | renderer, | ||
| PrimitiveKind | kind, | ||
| const std::string & | name, | ||
| const glm::vec3 & | position ) |
Spawns an entity with a basic geometric primitive mesh.
Spawns a primitive shape entity (e.g. Triangle, Cube, Quad).
| registry | Reference to the ECS Registry. |
| renderer | Reference to the Vulkan Renderer. |
| kind | The kind of primitive shape (Triangle, Cube, Quad). |
| name | Name of the spawned entity. |
| position | Initial position of the entity. |
| registry | Target ECS Registry. |
| renderer | Vulkan renderer context. |
| kind | Primitive kind (Triangle, Cube, Quad). |
| name | Entity name. |
| position | Translation vector. |
| void EntityFactory::uploadMesh | ( | Registry & | registry, |
| VulkanRenderer & | renderer, | ||
| Entity | entity ) |
Allocates and uploads GPU buffers for a mesh component on the specified entity.
Uploads mesh component data to Vulkan GPU buffers.