46 objectCenter = Eigen::Vector3f::Zero();
47 centroid = Eigen::Vector3f::Zero();
67 default_color = color;
143 model_matrix.scale(scale);
144 model_matrix.translate(-centroid);
152 model_matrix.translate(centroid);
153 model_matrix.scale(1.0/scale);
161 model_matrix = Eigen::Affine3f::Identity();
Eigen::Vector4f getColor(void)
Returns the default color of the model.
Definition: model.hpp:56
Eigen::Affine3f * modelMatrix(void)
Returns a pointer to the model matrix.
Definition: model.hpp:112
Eigen::Vector3f objectCenter
Center of the mesh object.
Definition: model.hpp:24
virtual Eigen::Vector3f getCentroid(void) const
Returns the centroid of the model.
Definition: model.hpp:84
Eigen::Vector4f default_color
Default color.
Definition: model.hpp:36
void desnormalizeModelMatrix(void)
Desnormalize model matrix.
Definition: model.hpp:150
Definition: bufferobject.hpp:34
The Model class is a holder for any kind of model, such as meshes, point clouds, surfaces ...
Definition: model.hpp:16
float getScale(void) const
Returns the scale factor for fitting the model inside a unit cube.
Definition: model.hpp:131
void setColor(const Eigen::Vector4f &color)
Sets the default color of the model.
Definition: model.hpp:65
Eigen::Vector3f centroid
Object's centroid (different from center of bounding box)
Definition: model.hpp:27
float scale
The normalization scale factor, scales the model matrix to fit the model inside a unit cube...
Definition: model.hpp:33
void setModelMatrix(const Eigen::Affine3f &m)
Sets the model matrix.
Definition: model.hpp:121
Model(void)
Definition: model.hpp:43
void resetModelMatrix(void)
Resets the model matrix.
Definition: model.hpp:159
virtual Eigen::Vector3f getObjectCenter(void) const
Returns the center of the axis-aligned bounding box.
Definition: model.hpp:75
Eigen::Affine3f model_matrix
Model matrix, holds information about the models location and orientation.
Definition: model.hpp:21
Eigen::Affine3f getModelMatrix(void) const
Returns the model matrix.
Definition: model.hpp:103
void normalizeModelMatrix(void)
Normalize model matrix to center and scale model. The model matrix will include a translation to plac...
Definition: model.hpp:141
virtual float getBoundingSphereRadius(void) const
Definition: model.hpp:94
float radius
Radius of the mesh bounding sphere.
Definition: model.hpp:30