gk::Triangle Struct Reference

representation d'un triangle 'geometrique'. More...

#include <Triangle.h>

List of all members.

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

Detailed Description

representation d'un triangle 'geometrique'.


Member Function Documentation

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.

Bug:
attention: les coordonnees UV renvoyees par cette fonction n'utilisent pas la meme convention que les fonctions de gk::Mesh. convention p(u, v, w= 1 - u - v)= a * w + b * u + c * v.

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().


The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Friends
Generated on Fri Dec 17 16:19:17 2010 for gKitGL by  doxygen 1.6.3