28#include "guillaume/ecs/component_registry.hpp"
29#include "guillaume/entities/builder_base.hpp"
30#include "guillaume/ecs/entity_builder.hpp"
31#include "guillaume/ecs/entity_filler.hpp"
33#include "guillaume/components/mesh.hpp"
34#include "guillaume/components/bound.hpp"
35#include "guillaume/components/transform.hpp"
77 std::string _meshPath;
78 std::string _texturePath;
103 void reset(
void)
override;
132 std::shared_ptr<Mesh>
makeMesh(std::shared_ptr<Entity> parent,
133 const std::string &meshPath,
134 const std::string &texturePath =
"");
147 template<
typename... Arguments>
148 static std::shared_ptr<Mesh>
create(Arguments &&...arguments)
150 std::shared_ptr<Mesh> entity(
151 new Mesh(std::forward<Arguments>(arguments)...));
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
The base class of a widget without children: an Entity that creates its components when it is constru...
Owns entities and gives the systems the list of entities to visit.
EntityBuilderBase(ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
std::shared_ptr< Mesh > makeMesh(std::shared_ptr< Entity > parent, const std::string &meshPath, const std::string &texturePath="")
Build a mesh, register it under parent and reset the builder.
void reset(void) override
Restore the defaults: empty model path and empty texture path.
Builder & withMeshPath(const std::string &meshPath)
Choose the model to draw.
Builder(ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
Construct a builder holding the defaults of reset().
std::shared_ptr< Mesh > buildEntity(void) override
Build a mesh from the current configuration, without registering it or giving it a parent.
Builder & withTexturePath(const std::string &texturePath)
Choose the texture applied to the model.
A 3D model loaded from a file, with an optional texture.
Mesh & setMeshPath(const std::string &meshPath)
Change the model to draw.
Mesh & setTexturePath(const std::string &texturePath)
Change the texture applied to the model.
static std::shared_ptr< Mesh > create(Arguments &&...arguments)
Build a mesh without registering it in an entity registry.
Mesh & setFitSize(std::optional< float > size)
Scale the model so its longest side has this length.
Widgets: the classes used to create entities with the right components and children.