![]() |
Stellarium
0.16.1
|
An axis-aligned bounding-box class. More...
#include <GeomMath.hpp>
Public Types | |
enum | Corner { MinMinMin = 0, MaxMinMin, MaxMaxMin, MinMaxMin, MinMinMax, MaxMinMax, MaxMaxMax, MinMaxMax, CORNERCOUNT } |
Identifies a corner of the AABB. More... | |
enum | Face { Front = 0, Back, Bottom, Top, Left, Right, FACECOUNT } |
Identifies a face of the AABB. More... | |
Public Member Functions | |
AABBox () | |
Creates an AABBox with minimum vertex set to infinity and maximum vertex set to -infinity. More... | |
AABBox (const Vec3f &min, const Vec3f &max) | |
Creates an AABBox with the specified minimum and maximum extents. More... | |
void | expand (const Vec3f &vec) |
Updates the bounding box to include the specified vertex. More... | |
void | expand (const AABBox &box) |
Updates the bounding box to include the specified other AABB. More... | |
void | reset () |
Resets minimum to infinity and maximum to -infinity (equivalent to creating a new AABBox with the default constructor) More... | |
bool | isValid () const |
Returns true when each component of the minimum extents is smaller than the corresponding component of the maximum extents. More... | |
float | getVolume () const |
Returns the volume of the bounding box. More... | |
Vec3f | getCorner (AABBox::Corner corner) const |
Returns the coordinates of the specified corner of the AABB. More... | |
Vec4f | getPlane (AABBox::Face p) const |
Return the plane equation in the general form for the specified face of the AABB as Vec4f. More... | |
Vec3f | positiveVertex (Vec3f &normal) const |
Returns a Vec3f that for each component either: More... | |
Vec3f | negativeVertex (Vec3f &normal) const |
Returns a Vec3f that for each component either: More... | |
Public Attributes | |
Vec3f | min |
The minimal extents of the box. More... | |
Vec3f | max |
The maximal extents of the box. More... | |
An axis-aligned bounding-box class.
Definition at line 31 of file GeomMath.hpp.
enum AABBox::Corner |
Identifies a corner of the AABB.
Definition at line 35 of file GeomMath.hpp.
enum AABBox::Face |
Identifies a face of the AABB.
Definition at line 43 of file GeomMath.hpp.
AABBox::AABBox | ( | ) |
Creates an AABBox with minimum vertex set to infinity and maximum vertex set to -infinity.
Creates an AABBox with the specified minimum and maximum extents.
void AABBox::expand | ( | const Vec3f & | vec | ) |
Updates the bounding box to include the specified vertex.
void AABBox::expand | ( | const AABBox & | box | ) |
Updates the bounding box to include the specified other AABB.
Vec3f AABBox::getCorner | ( | AABBox::Corner | corner | ) | const |
Returns the coordinates of the specified corner of the AABB.
Vec4f AABBox::getPlane | ( | AABBox::Face | p | ) | const |
Return the plane equation in the general form for the specified face of the AABB as Vec4f.
float AABBox::getVolume | ( | ) | const |
Returns the volume of the bounding box.
bool AABBox::isValid | ( | ) | const |
Returns true when each component of the minimum extents is smaller than the corresponding component of the maximum extents.
This allows to detect empty (or freshly created) boxes with negative volume, or AABBs with only a single vertex (where the minimum and maximum extents are the same).
Returns a Vec3f that for each component either:
normal
parameter is less than zero,Returns a Vec3f that for each component either:
normal
parameter is less than zero,void AABBox::reset | ( | ) |
Resets minimum to infinity and maximum to -infinity (equivalent to creating a new AABBox with the default constructor)
Vec3f AABBox::max |
The maximal extents of the box.
Definition at line 95 of file GeomMath.hpp.
Vec3f AABBox::min |
The minimal extents of the box.
Definition at line 93 of file GeomMath.hpp.