#include <aabb.h>
Public Member Functions | |
AABB () | |
Default constructor, initializing the box to the degenerate case of minimum=+inf, maximum=-inf. | |
AABB (const Point &p) | |
Constructor initializing the box to a single points. | |
AABB (const Point &p1, const Point &p2) | |
Constructor initializing the box to include two points. | |
AABB (const Point &p1, const Point &p2, const Point &p3) | |
Constructor initializing the box to include three points. | |
virtual | ~AABB () |
Destructor. | |
void | init (const Point &p) |
Initializes the bounding box to a single point. | |
void | include (const Point &p) |
Sets the bounding box to the union of the current box and the point p. | |
void | include (const AABB &b) |
Sets the bounding box to the union of the current box and the box b. | |
void | grow (float d) |
Grow the box by a distance d in all directions. | |
float | getVolume () const |
Returns the volume of the bounding box. | |
float | getArea () const |
Returns the surface area of the bounding box. | |
int | getLargestAxis () const |
Returns the index of the largest axis in the range [0,2]. | |
bool | intersect (const Ray &r, float &tmin, float &tmax) const |
Performs ray/box intersection. | |
Public Attributes | |
Point | mMin |
Minimum. | |
Point | mMax |
Maximum. |