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 |
renvoie l'aire du triangle. | |
Normal | getNormal () const |
renvoie la normale du triangle. | |
BBox | getBBox () const |
renvoie la boite englabante du triangle. | |
Triangle | transform (const Transform &t) |
renvoie un triangle transforme par 't'. | |
bool | Intersect (const Ray &ray, const float htmin, const float htmax, float &rt, float &ru, float &rv) const |
intersection avec un rayon. | |
bool | Intersect (const float *origin, const float *direction, const float tmin, const float tmax, float *rt, float *ru, float *rv) const |
intersection avec un rayon. | |
Public Attributes | |
Point | a |
Point | b |
Point | c |
representation d'un triangle 'geometrique'.
bool gk::Triangle::Intersect | ( | const Ray & | ray, | |
const float | htmin, | |||
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. 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.
Referenced by Intersect().
bool gk::Triangle::Intersect | ( | const float * | origin, | |
const float * | direction, | |||
const float | tmin, | |||
const float | tmax, | |||
float * | rt, | |||
float * | ru, | |||
float * | rv | |||
) | const [inline] |
intersection avec un rayon.
version C, utilisable avec vec.h et mat44.h. cf. Intersect( const Ray &ray, ... ) pour les explications detaillees.
References Intersect().