31 name =
"unknown triangle";
34 Triangle(
unsigned int p1,
unsigned int p2,
unsigned int p3, std::vector<vec3>* _vertices,
Material* _m,
35 const bool&
isSol =
false);
61 virtual bool sample(
decimal density, std::vector<vec3>& samples);
std::string name
Each instantiated object may be named.
: 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,...)
BBox box
Bounding box of the shape.
bool isSol() const
Get/Set the flag _isSol (ground or not)
virtual bool sample(decimal density, std::vector< vec3 > &samples)
Uncommented method cause not used.
void setNormal(const vec3 &_normal)
Set/Get the normal.
vec3 normal
Normal to triangle.
virtual bool getIntersection(Ray &ray, Intersection &inter)
Get the Intersection between a ray and this shape.
Triangle(const Triangle &other)
Copy constructor.
virtual void updateBBox()
Update the bounding box:
virtual int form()
Return type of the shape.
virtual ~Triangle()
Destructor.
vec3 v
Vector to reach the third vertex (vertex3=p+v)
vec3 u
Vector to reach the second vertex (vertex2=p+u)
Triangle()
Default constructor.
vec3 p
First vertex (vertex1=p)
virtual vec3 getNormal(const vec3 pos=vec3())
Get normal.
base_vec3< decimal > vec3