46 for (
unsigned int i = 0; i < _vertices.size(); i++)
59 for (
unsigned int i = 0; i < _triangles.size(); i++)
61 triangles.push_back(ivec3(_triangles.at(i)));
void setTriangles(const std::vector< ivec3 > &_triangles)
void clear()
Clear arrays.
std::vector< ivec3 > & getTriangles()
Get/Set triangles of the mesh.
std::vector< ivec3 > triangles
Triangles of the mesh.
std::vector< vec3 > & getVertices()
Get/Set the vertices of the mesh.
void setVertices(const std::vector< vec3 > &_vertices)
virtual bool getIntersection(Ray &ray, Intersection &inter)
Get the Intersection between a ray and this shape.
virtual ~Mesh()
Destructor.
std::vector< vec3 > vertices
Vertices of the mesh.
bool addTriangle(const ivec3 newTriangle, Material *m)
Add a triangle to the mesh with the material m.
: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-40...
base class for shapes (Cylindre, Mesh, Sphere, Triangle,...)
base_vec3< decimal > vec3