Public Member Functions | Public Attributes | Static Public Attributes

sp::dim::aabbox3d< T > Class Template Reference

Axis aligned bounding box (AABB) class for bounding volume tests. More...

#include <spDimensionAABB.hpp>

List of all members.

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

Detailed Description

template<typename T>
class sp::dim::aabbox3d< T >

Axis aligned bounding box (AABB) class for bounding volume tests.


Constructor & Destructor Documentation

template<typename T>
sp::dim::aabbox3d< T >::aabbox3d (  )  [inline]
template<typename T>
sp::dim::aabbox3d< T >::aabbox3d ( const vector3d< T > &  MinEdge,
const vector3d< T > &  MaxEdge 
) [inline]
template<typename T>
sp::dim::aabbox3d< T >::aabbox3d ( const line3d< T > &  Line  )  [inline]
template<typename T>
sp::dim::aabbox3d< T >::aabbox3d ( const aabbox3d< T > &  Other  )  [inline]
template<typename T>
sp::dim::aabbox3d< T >::~aabbox3d (  )  [inline]

Member Function Documentation

template<typename T>
bool sp::dim::aabbox3d< T >::checkBoxBoxIntersection ( const aabbox3d< T > &  other  )  const [inline]

Returns true if the two AABBs intersects.

template<typename T>
DefineConstOperator* sp::dim::aabbox3d< T >::DefineConstOperator (  )  const
template<typename T>
bool sp::dim::aabbox3d< T >::empty ( f32  Tolerance = math::ROUNDING_ERROR  )  const [inline]

Returns true if minimum and maximum are equal.

template<typename T >
plane3d< T > sp::dim::aabbox3d< T >::getBackPlane (  )  const [inline]
template<typename T>
quadrangle3d<T> sp::dim::aabbox3d< T >::getBackQuad (  )  const [inline]
template<typename T >
plane3d< T > sp::dim::aabbox3d< T >::getBottomPlane (  )  const [inline]
template<typename T>
quadrangle3d<T> sp::dim::aabbox3d< T >::getBottomQuad (  )  const [inline]
template<typename T>
T sp::dim::aabbox3d< T >::getBoxVolume (  )  const [inline]

Returns the bounding box's volume.

template<typename T >
vector3d< T > sp::dim::aabbox3d< T >::getClosestPoint ( const plane3d< T > &  Plane  )  const [inline]

Returns the closest point on the plane.

template<typename T>
vector3d<T> sp::dim::aabbox3d< T >::getCorner ( u32  Index  )  const [inline]

Returns a corner of this box.

Parameters:
Index,: Specifies the corners index. This must be a value in the range [0 .. 7].
Returns:
3D vector containing the corner coordinate.
template<typename T>
line3d<T> sp::dim::aabbox3d< T >::getEdge ( u32  Index  )  const [inline]
template<typename T >
plane3d< T > sp::dim::aabbox3d< T >::getFrontPlane (  )  const [inline]
template<typename T>
quadrangle3d<T> sp::dim::aabbox3d< T >::getFrontQuad (  )  const [inline]
template<typename T >
plane3d< T > sp::dim::aabbox3d< T >::getLeftPlane (  )  const [inline]
template<typename T>
quadrangle3d<T> sp::dim::aabbox3d< T >::getLeftQuad (  )  const [inline]
template<typename T>
vector3d<T> sp::dim::aabbox3d< T >::getMaxRadius (  )  const [inline]

Returns the maximal absolute vector of min and max components.

        aabbox3df(vector3df(-4, -2, -3), vector3df(1, 5, 6)).getMaxRadius() == vector3df(4, 5, 6);
template<typename T>
plane3d<T> sp::dim::aabbox3d< T >::getPlane ( u32  Index  )  const [inline]
template<typename T >
plane3d< T > sp::dim::aabbox3d< T >::getRightPlane (  )  const [inline]
template<typename T>
quadrangle3d<T> sp::dim::aabbox3d< T >::getRightQuad (  )  const [inline]
template<typename T>
aabbox3d<T> sp::dim::aabbox3d< T >::getScaled ( const vector3d< T > &  Size  )  const [inline]

Returns a copy of this box multiplied by the specified size.

template<typename T >
plane3d< T > sp::dim::aabbox3d< T >::getTopPlane (  )  const [inline]
template<typename T>
quadrangle3d<T> sp::dim::aabbox3d< T >::getTopQuad (  )  const [inline]
template<typename T>
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.

template<typename T>
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.

template<typename T>
bool sp::dim::aabbox3d< T >::isBoxInside ( const aabbox3d< T > &  other  )  const [inline]

Returns true if the given AABB is completely inside this box.

template<typename T>
bool sp::dim::aabbox3d< T >::isPointInside ( const vector3d< T > &  Point  )  const [inline]

Returns true if the specified point is inside the box.

template<typename T>
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".

template<typename T>
bool sp::dim::aabbox3d< T >::valid (  )  const [inline]

Returns true if this is a valid box.


Member Data Documentation

template<typename T>
const aabbox3d< T > sp::dim::aabbox3d< T >::CUBE [static]

Default cube with a size of 1 (-0.5 to 0.5).

template<typename T>
const aabbox3d< T > sp::dim::aabbox3d< T >::IDENTITY [static]

Identity bounding box (-1 to 1).

template<typename T>
vector3d<T> sp::dim::aabbox3d< T >::Max

Right-upper-back corner of the bounding box.

template<typename T>
vector3d<T> sp::dim::aabbox3d< T >::Min

Left-lower-front corner of the bounding box.

template<typename T>
const aabbox3d< T > sp::dim::aabbox3d< T >::OMEGA [static]

Largest invalid bounding box (999999 to -999999).


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines