Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
EntityFactory.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <glm/glm.hpp>
4#include "ecs/Entity.hpp"
5#include "ecs/Registry.hpp"
7
9
14namespace EntityFactory {
24 Entity spawnPrimitive(Registry& registry, VulkanRenderer& renderer, PrimitiveKind kind, const std::string& name, const glm::vec3& position);
25
36 Entity spawnCamera(Registry& registry, VulkanRenderer& renderer, const std::string& name, const glm::vec3& position, const glm::vec3& rotation, float fov);
37
50 Entity 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);
51
55 Entity spawnAnimatedModel(Registry& registry, VulkanRenderer& renderer, const std::string& name, const std::string& gltfPath, const glm::vec3& position);
56
63 void uploadMesh(Registry& registry, VulkanRenderer& renderer, Entity entity);
64}
PrimitiveKind
Enum representing kinds of supported geometric primitives.
Definition PrimitiveType.hpp:7
Lightweight identifier representing a game object in the Entity Component System.
Definition Entity.hpp:11
Coordinates entities and components, providing creation, removal, lookup, and views.
Definition Registry.hpp:30
Manages core Vulkan pipeline states, device interaction, frames, buffers, and command submissions.
Definition VulkanRenderer.hpp:127
Factory functions to create, configure, and initialize typical entities and their Vulkan rendering re...
Entity 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.
Definition EntityFactory.cpp:146
Entity spawnPrimitive(Registry &registry, VulkanRenderer &renderer, PrimitiveKind kind, const std::string &name, const glm::vec3 &position)
Spawns an entity with a basic geometric primitive mesh.
Definition EntityFactory.cpp:52
Entity 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.
Definition EntityFactory.cpp:177
Entity spawnCamera(Registry &registry, VulkanRenderer &renderer, const std::string &name, const glm::vec3 &position, const glm::vec3 &rotation, float fov)
Spawns a camera entity.
Definition EntityFactory.cpp:105
void uploadMesh(Registry &registry, VulkanRenderer &renderer, Entity entity)
Allocates and uploads GPU buffers for a mesh component on the specified entity.
Definition EntityFactory.cpp:30
const char * name
Definition ufbx.cpp:9020