representation d'une boite englobante alignee sur les axes (aabox). More...
#include <Geometry.h>
Public Member Functions | |
BBox () | |
constructeur par defaut. | |
void | clear () |
re-initialise les extremites. | |
BBox (const Point &p) | |
construction de l'aabbox d'un point, cf. Union( aabox, q ) pour ajouter d'autres points. | |
BBox (const Point &p1, const Point &p2) | |
construction d'une aabox connaissant 2 points. | |
void | print () const |
void | Union (const BBox &bbox) |
ajoute une autre aabox | |
void | Union (const Point &p) |
ajoute un point a la bbox. | |
bool | Overlaps (const BBox &b) const |
verifie l'intersection de 2 aabbox. | |
bool | Inside (const Point &pt) const |
verifie l'inclusion d'un point dans l'aabox. | |
void | Expand (float delta) |
dilate l'aabox de 'delta' dans toutes les directions. | |
const Point | getCenter () const |
renvoie le centre de la boite. | |
void | getCenter (Point ¢er) const |
renvoie le centre de la boite | |
float | Volume () const |
renvoie le volume de l'aabox. | |
float | SurfaceArea () const |
renvoie l'aire de l'aabox | |
int | MaximumExtent () const |
renvoie l'indice de l'axe le plus long de l'aabox, 0 pour X, 1 pour Y et 2 pour Z. | |
void | BoundingSphere (Point &c, float &r) const |
renvoie une sphere englobante de l'aabox. | |
bool | Intersect (const Ray &ray, const float htmax, float &rtmin, float &rtmax) const |
intersection avec rayon. | |
bool | Occluded (const Ray &ray) const |
bool | Intersect (const Ray &ray, const float htmax, float &rtmin, float &rtmax, Normal &rn) const |
renvoie egalement la normale de l'intersection. | |
bool | Intersect (const float *origin, const float *direction, const float tmin, const float tmax, float *hit0, float *hit1) const |
intersection avec un rayon, version C, utilisable avec vec.h et mat44.h. | |
Point & | operator[] (const int id) |
acces indexe aux extremes de l'aabox. | |
const Point & | operator[] (const int id) const |
acces indexe aux extremes de l'aabox. | |
Public Attributes | |
Point | pMin |
points extremes de l'aabox. | |
Point | pMax |
Friends | |
std::ostream & | operator<< (std::ostream &os, const BBox &b) |
BBox | Union (const BBox &b, const Point &p) |
ajoute un point dans l'aabox. | |
BBox | Union (const BBox &b, const BBox &b2) |
ajoute une autre aabox. |
representation d'une boite englobante alignee sur les axes (aabox).
bool gk::BBox::Intersect | ( | const Ray & | ray, | |
const float | htmax, | |||
float & | rtmin, | |||
float & | rtmax | |||
) | const [inline] |
intersection avec rayon.
renvoie faux si l'intersection existe mais n'est pas dans l'intervalle [htmin htmax].
"An Efficient and Robust Ray-Box Intersection Algorithm" cf http://cag.csail.mit.edu/%7Eamy/papers/box-jgt.pdf
References gk::Ray::inv_d, gk::Ray::o, gk::Ray::sign_d, and gk::Vector::x.
Referenced by Intersect().