VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
ModelCreator.cpp
1#include <string>
3
4#include "Engine.hpp"
7#include "components/backends/vulkan/MeshManager.hpp"
8
9namespace vex {
10 ModelObject* createModelFromComponents(const std::string& name, MeshComponent meshComponent, TransformComponent transformComponent, Engine& engine, vex::Entity parent){
11 return engine.getInterface()->getMeshManager().createModel(name, meshComponent, transformComponent, parent);
12 }
13 MeshComponent createMeshFromPath(const std::string& path, Engine& engine){
14 return engine.getInterface()->getMeshManager().loadMesh(path);
15 }
16 ModelObject* createModelFromPath(const std::string& path, const std::string& name, Engine& engine, vex::Entity parent){
17 MeshComponent meshComponent = createMeshFromPath(path, engine);
18 TransformComponent transformComponent(engine.getRegistry());
19 return createModelFromComponents(name, meshComponent, transformComponent, engine, parent);
20 }
21}
Contains basic components like transform, camera, name components..
Contains main Engine class.
This file defines interface Class for vulkan backend.
This file defines functions for creating model objects and mesh components.
Class for interaction with engine systems.
Definition Engine.hpp:47
Interface * getInterface()
Returns Interface, used internally.
Definition Engine.cpp:106
vex::Registry & getRegistry()
Returns a reference to vex::Registry.
Definition Engine.hpp:147
MeshManager & getMeshManager()
Getter for MeshManager.
Definition Interface.hpp:71
MeshComponent loadMesh(const std::string &path)
Loads mesh from a file, creates vulkan mesh and returns a MeshComponent.
ModelObject * createModel(const std::string &name, MeshComponent meshComponent, TransformComponent transformComponent, vex::Entity parent)
Creates a model object from a mesh component, transform component, and parent entity.
ModelObject class represents a model object in the engine. Thanks to engine separation from the backe...
uint32_t Entity
Type alias representing a unique entity identifier in the ECS system.
Definition Types.hpp:11
ModelObject * createModelFromComponents(const std::string &name, MeshComponent meshComponent, TransformComponent transformComponent, Engine &engine, vex::Entity parent=vex::NULL_ENTITY)
Creates model object From mesh and tranform components.
MeshComponent createMeshFromPath(const std::string &path, Engine &engine)
Just creates meshcomponent from file. Copies meshData and texture paths for later backend specific pr...
ModelObject * createModelFromPath(const std::string &path, const std::string &name, Engine &engine, vex::Entity parent=vex::NULL_ENTITY)
Creates model object from file. Esentially just runs two other functions just with empty transform co...
Struct containing raw meshData, mesh id, texture paths and material properties. It just template and ...
Struct containing transform data and methods.