Axis aligned bounding box (AABB) class for bounding volume tests. More...
#include <spDimensionAABB.hpp>
Public Member Functions | |
aabbox3d () | |
aabbox3d (const vector3d< T > &MinEdge, const vector3d< T > &MaxEdge) | |
aabbox3d (const line3d< T > &Line) | |
aabbox3d (const aabbox3d< T > &Other) | |
~aabbox3d () | |
DefineConstOperator * | DefineConstOperator (/) DefineConstOperator(+) DefineConstOperator(-) DefineOperator(*=) DefineOperator(/=) DefineOperator(+=) DefineOperator(-=) inline vector3d< T > getCenter() const {return(Min+Max)/2;}inline vector3d< T > getSize() const {return Max-Min;}inline T getVolume() const {return getSize().getVolume( |
bool | checkBoxBoxIntersection (const aabbox3d< T > &other) const |
Returns true if the two AABBs intersects. | |
bool | isBoxInside (const aabbox3d< T > &other) const |
Returns true if the given AABB is completely inside this box. | |
bool | isPointInside (const vector3d< T > &Point) const |
Returns true if the specified point is inside the box. | |
bool | empty (f32 Tolerance=math::ROUNDING_ERROR) const |
Returns true if minimum and maximum are equal. | |
bool | valid () const |
Returns true if this is a valid box. | |
aabbox3d< T > & | repair () |
Repairs the bounding box if any component of "Min" is greater then the corresponding component of "Max". | |
void | insertPoint (const vector3d< T > &Point) |
Inserts a point to the bounding box. This can result in that the box becomes larger. | |
void | insertBox (const aabbox3d< T > &Other) |
Inserts the min- and max points of the given box to this bounding box. This can result in that the box becomes larger. | |
T | getBoxVolume () const |
Returns the bounding box's volume. | |
aabbox3d< T > | getScaled (const vector3d< T > &Size) const |
Returns a copy of this box multiplied by the specified size. | |
vector3d< T > | getMaxRadius () const |
plane3d< T > | getLeftPlane () const |
plane3d< T > | getRightPlane () const |
plane3d< T > | getTopPlane () const |
plane3d< T > | getBottomPlane () const |
plane3d< T > | getFrontPlane () const |
plane3d< T > | getBackPlane () const |
plane3d< T > | getPlane (u32 Index) const |
quadrangle3d< T > | getLeftQuad () const |
quadrangle3d< T > | getRightQuad () const |
quadrangle3d< T > | getTopQuad () const |
quadrangle3d< T > | getBottomQuad () const |
quadrangle3d< T > | getFrontQuad () const |
quadrangle3d< T > | getBackQuad () const |
vector3d< T > | getCorner (u32 Index) const |
line3d< T > | getEdge (u32 Index) const |
vector3d< T > | getClosestPoint (const plane3d< T > &Plane) const |
Returns the closest point on the plane. | |
Public Attributes | |
vector3d< T > | Min |
Left-lower-front corner of the bounding box. | |
vector3d< T > | Max |
Right-upper-back corner of the bounding box. | |
Static Public Attributes | |
static const aabbox3d< T > | OMEGA |
Largest invalid bounding box (999999 to -999999). | |
static const aabbox3d< T > | IDENTITY |
Identity bounding box (-1 to 1). | |
static const aabbox3d< T > | CUBE |
Default cube with a size of 1 (-0.5 to 0.5). |
Axis aligned bounding box (AABB) class for bounding volume tests.
sp::dim::aabbox3d< T >::aabbox3d | ( | ) | [inline] |
sp::dim::aabbox3d< T >::aabbox3d | ( | const vector3d< T > & | MinEdge, | |
const vector3d< T > & | MaxEdge | |||
) | [inline] |
sp::dim::aabbox3d< T >::aabbox3d | ( | const line3d< T > & | Line | ) | [inline] |
sp::dim::aabbox3d< T >::aabbox3d | ( | const aabbox3d< T > & | Other | ) | [inline] |
sp::dim::aabbox3d< T >::~aabbox3d | ( | ) | [inline] |
bool sp::dim::aabbox3d< T >::checkBoxBoxIntersection | ( | const aabbox3d< T > & | other | ) | const [inline] |
Returns true if the two AABBs intersects.
DefineConstOperator* sp::dim::aabbox3d< T >::DefineConstOperator | ( | / | ) | const |
bool sp::dim::aabbox3d< T >::empty | ( | f32 | Tolerance = math::ROUNDING_ERROR |
) | const [inline] |
Returns true if minimum and maximum are equal.
plane3d< T > sp::dim::aabbox3d< T >::getBackPlane | ( | ) | const [inline] |
quadrangle3d<T> sp::dim::aabbox3d< T >::getBackQuad | ( | ) | const [inline] |
plane3d< T > sp::dim::aabbox3d< T >::getBottomPlane | ( | ) | const [inline] |
quadrangle3d<T> sp::dim::aabbox3d< T >::getBottomQuad | ( | ) | const [inline] |
T sp::dim::aabbox3d< T >::getBoxVolume | ( | ) | const [inline] |
Returns the bounding box's volume.
vector3d< T > sp::dim::aabbox3d< T >::getClosestPoint | ( | const plane3d< T > & | Plane | ) | const [inline] |
Returns the closest point on the plane.
vector3d<T> sp::dim::aabbox3d< T >::getCorner | ( | u32 | Index | ) | const [inline] |
Returns a corner of this box.
Index,: | Specifies the corners index. This must be a value in the range [0 .. 7]. |
line3d<T> sp::dim::aabbox3d< T >::getEdge | ( | u32 | Index | ) | const [inline] |
plane3d< T > sp::dim::aabbox3d< T >::getFrontPlane | ( | ) | const [inline] |
quadrangle3d<T> sp::dim::aabbox3d< T >::getFrontQuad | ( | ) | const [inline] |
plane3d< T > sp::dim::aabbox3d< T >::getLeftPlane | ( | ) | const [inline] |
quadrangle3d<T> sp::dim::aabbox3d< T >::getLeftQuad | ( | ) | const [inline] |
vector3d<T> sp::dim::aabbox3d< T >::getMaxRadius | ( | ) | const [inline] |
plane3d<T> sp::dim::aabbox3d< T >::getPlane | ( | u32 | Index | ) | const [inline] |
plane3d< T > sp::dim::aabbox3d< T >::getRightPlane | ( | ) | const [inline] |
quadrangle3d<T> sp::dim::aabbox3d< T >::getRightQuad | ( | ) | const [inline] |
aabbox3d<T> sp::dim::aabbox3d< T >::getScaled | ( | const vector3d< T > & | Size | ) | const [inline] |
Returns a copy of this box multiplied by the specified size.
plane3d< T > sp::dim::aabbox3d< T >::getTopPlane | ( | ) | const [inline] |
quadrangle3d<T> sp::dim::aabbox3d< T >::getTopQuad | ( | ) | const [inline] |
void sp::dim::aabbox3d< T >::insertBox | ( | const aabbox3d< T > & | Other | ) | [inline] |
Inserts the min- and max points of the given box to this bounding box. This can result in that the box becomes larger.
void sp::dim::aabbox3d< T >::insertPoint | ( | const vector3d< T > & | Point | ) | [inline] |
Inserts a point to the bounding box. This can result in that the box becomes larger.
bool sp::dim::aabbox3d< T >::isBoxInside | ( | const aabbox3d< T > & | other | ) | const [inline] |
Returns true if the given AABB is completely inside this box.
bool sp::dim::aabbox3d< T >::isPointInside | ( | const vector3d< T > & | Point | ) | const [inline] |
Returns true if the specified point is inside the box.
aabbox3d<T>& sp::dim::aabbox3d< T >::repair | ( | ) | [inline] |
Repairs the bounding box if any component of "Min" is greater then the corresponding component of "Max".
bool sp::dim::aabbox3d< T >::valid | ( | ) | const [inline] |
Returns true if this is a valid box.
const aabbox3d< T > sp::dim::aabbox3d< T >::CUBE [static] |
Default cube with a size of 1 (-0.5 to 0.5).
const aabbox3d< T > sp::dim::aabbox3d< T >::IDENTITY [static] |
Identity bounding box (-1 to 1).
vector3d<T> sp::dim::aabbox3d< T >::Max |
Right-upper-back corner of the bounding box.
vector3d<T> sp::dim::aabbox3d< T >::Min |
Left-lower-front corner of the bounding box.
const aabbox3d< T > sp::dim::aabbox3d< T >::OMEGA [static] |
Largest invalid bounding box (999999 to -999999).