28#include "guillaume/ecs/component.hpp"
59 std::string _meshPath {};
60 std::string _texturePath {};
61 std::optional<float> _fitSize {};
114 const std::optional<float> &
getFitSize(
void)
const noexcept;
134 float scaleFor(
float modelWidth,
float modelHeight)
const noexcept;
const std::optional< float > & getFitSize(void) const noexcept
Get the size the model is scaled to.
Mesh(void)=default
Default constructor for the Mesh component.
std::string getMeshPath(void) const
Get the path of the model file.
Mesh & setTexturePath(const std::string &path)
Choose the texture applied to the model.
float scaleFor(float modelWidth, float modelHeight) const noexcept
Get the factor that turns model units into dp.
Mesh & setMeshPath(const std::string &path)
Choose the model to show.
std::string getTexturePath(void) const
Get the path of the texture file.
~Mesh(void)=default
Default destructor for the Mesh component.
Mesh & setFitSize(std::optional< float > size)
Scale the model so its longest side has this length.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
State. Every class here is plain data attached to an entity.