23#include "guillaume/components/mesh.hpp"
31 if (_meshPath == path) {
46 if (_texturePath == path) {
66 if (_fitSize != size) {
75 const float longest = std::max(modelWidth, modelHeight);
77 if (!_fitSize.has_value() || longest <= 0.0f) {
80 return *_fitSize / longest;
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 & setFitSize(std::optional< float > size)
Scale the model so its longest side has this length.
void setHasChanged(bool hasChanged)
Raise or lower the changed flag.
State. Every class here is plain data attached to an entity.