representation d'un triangle 'geometrique'. More...
#include <Triangle.h>
Public Member Functions | |
| Triangle () | |
| constructeur par defaut. | |
| Triangle (const Point &a, const Point &b, const Point &c) | |
| construit un triangle connaissant ses 3 sommets. | |
| ~Triangle () | |
| destructeur. | |
| float | getArea () const |
| Normal | getNormal () const |
| BBox | getBBox () const |
| Triangle | transform (const Transform &t) |
| renvoie un triangle transforme par 't'. | |
| bool | Intersect (const Ray &ray, const float htmax, float &rt, float &ru, float &rv) const |
| intersection avec un rayon. | |
| Point | getUVPoint (const float u, const float v) const |
| convention p(u, v)= (1 - u - v) * a + u * b + v * c | |
| float | sampleUniform (Sampler &sampler, Point &p) const |
| float | pdfUniform (const Point &p) const |
Public Attributes | |
| Point | a |
| Point | b |
| Point | c |
| float | area |
representation d'un triangle 'geometrique'.
| bool gk::Triangle::Intersect | ( | const Ray & | ray, | |
| const float | htmax, | |||
| float & | rt, | |||
| float & | ru, | |||
| float & | rv | |||
| ) | const [inline] |
intersection avec un rayon.
renvoie faux s'il n'y a pas d'intersection, une intersection peut exister mais peut ne pas se trouver dans [tmin tmax] du rayon. renvoie vrai + les coordonnees barycentriques du point d'intersection + sa position le long du rayon. convention barycentrique : t(u, v)= (1 - u - v) * a + u * b + v * c utiliser Mesh::getUVNormal() et Mesh::getUVTexCoord() pour interpoler les attributs du point d'intersection.
References gk::Cross(), gk::Ray::d, gk::Dot(), and gk::Ray::o.
1.6.3