voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
blub::axisAlignedBox Class Reference

Public Types

enum  Extent { EXTENT_NULL, EXTENT_FINITE, EXTENT_INFINITE }
 
enum  CornerEnum {
  FAR_LEFT_BOTTOM = 0, FAR_LEFT_TOP = 1, FAR_RIGHT_TOP = 2, FAR_RIGHT_BOTTOM = 3,
  NEAR_RIGHT_BOTTOM = 7, NEAR_LEFT_BOTTOM = 6, NEAR_LEFT_TOP = 5, NEAR_RIGHT_TOP = 4
}
 

Public Member Functions

 axisAlignedBox (const axisAlignedBoxInt32 &toCast)
 
 axisAlignedBox (const Ogre::AxisAlignedBox &vec)
 
 operator Ogre::AxisAlignedBox () const
 
 axisAlignedBox (Extent e)
 
 axisAlignedBox (const axisAlignedBox &rkBox)
 
 axisAlignedBox (const vector3 &min, const vector3 &max)
 
 axisAlignedBox (real mx, real my, real mz, real Mx, real My, real Mz)
 
axisAlignedBoxoperator= (const axisAlignedBox &rhs)
 
const vector3getMinimum (void) const
 
vector3getMinimum (void)
 
const vector3getMaximum (void) const
 
vector3getMaximum (void)
 
void setMinimum (const vector3 &vec)
 
void setMinimum (real x, real y, real z)
 
void setMinimumX (real x)
 
void setMinimumY (real y)
 
void setMinimumZ (real z)
 
void setMaximum (const vector3 &vec)
 
void setMaximum (real x, real y, real z)
 
void setMaximumX (real x)
 
void setMaximumY (real y)
 
void setMaximumZ (real z)
 
void setExtents (const vector3 &min, const vector3 &max)
 
void setExtents (real mx, real my, real mz, real Mx, real My, real Mz)
 
vector3 getCorner (CornerEnum cornerToGet) const
 
void merge (const axisAlignedBox &rhs)
 
void merge (const vector3 &point)
 
void setNull ()
 
bool isNull (void) const
 
bool isFinite (void) const
 
void setInfinite ()
 
bool isInfinite (void) const
 
bool intersects (const axisAlignedBox &b2) const
 
axisAlignedBox intersection (const axisAlignedBox &b2) const
 Calculate the area of intersection of this box and another.
 
real volume (void) const
 Calculate the volume of this box.
 
void scale (const vector3 &s)
 
bool intersects (const sphere &s) const
 
bool intersects (const plane &p) const
 
bool intersects (const vector3 &v) const
 
vector3 getCenter (void) const
 Gets the centre of the box.
 
vector3 getSize (void) const
 Gets the size of the box.
 
vector3 getHalfSize (void) const
 Gets the half-size of the box.
 
bool contains (const vector3 &v) const
 
real distance (const vector3 &v) const
 
bool contains (const axisAlignedBox &other) const
 
bool operator== (const axisAlignedBox &rhs) const
 
bool operator!= (const axisAlignedBox &rhs) const
 
axisAlignedBox move (const vector3 &vec) const
 
axisAlignedBox operator* (const real &mul) const
 
axisAlignedBoxoperator*= (const real &mul)
 
axisAlignedBox operator/ (const real &mul) const
 
void setMinimumAndMaximum (const vector3 &min, const vector3 &max)
 

Static Public Attributes

static const axisAlignedBox BOX_NULL
 
static const axisAlignedBox BOX_INFINITE
 

Protected Attributes

vector3 mMinimum
 
vector3 mMaximum
 
Extent mExtent
 

Detailed Description

Examples:
customVertexInformation.cpp, noise.cpp, and primitives.cpp.

Member Function Documentation

bool blub::axisAlignedBox::contains ( const vector3 v) const
inline

Tests whether the given point contained by this box.

bool blub::axisAlignedBox::contains ( const axisAlignedBox other) const
inline

Tests whether another box contained by this box.

real axisAlignedBox::distance ( const vector3 v) const

Returns the minimum distance between a given point and any part of the box.

vector3 blub::axisAlignedBox::getCorner ( CornerEnum  cornerToGet) const
inline

gets the position of one of the corners

const vector3& blub::axisAlignedBox::getMaximum ( void  ) const
inline

Gets the maximum corner of the box.

vector3& blub::axisAlignedBox::getMaximum ( void  )
inline

Gets a modifiable version of the maximum corner of the box.

const vector3& blub::axisAlignedBox::getMinimum ( void  ) const
inline

Gets the minimum corner of the box.

vector3& blub::axisAlignedBox::getMinimum ( void  )
inline

Gets a modifiable version of the minimum corner of the box.

bool blub::axisAlignedBox::intersects ( const axisAlignedBox b2) const
inline

Returns whether or not this box intersects another.

bool blub::axisAlignedBox::intersects ( const sphere s) const

Tests whether this box intersects a sphere.

bool blub::axisAlignedBox::intersects ( const plane p) const

Tests whether this box intersects a plane.

bool blub::axisAlignedBox::intersects ( const vector3 v) const
inline

Tests whether the vector point is within this box.

bool blub::axisAlignedBox::isFinite ( void  ) const
inline

Returns true if the box is finite.

bool blub::axisAlignedBox::isInfinite ( void  ) const
inline

Returns true if the box is infinite.

bool blub::axisAlignedBox::isNull ( void  ) const
inline

Returns true if the box is null i.e. empty.

void blub::axisAlignedBox::merge ( const axisAlignedBox rhs)
inline

Merges the passed in box into the current box. The result is the box which encompasses both.

void blub::axisAlignedBox::merge ( const vector3 point)
inline

Extends the box to encompass the specified point (if needed).

bool blub::axisAlignedBox::operator!= ( const axisAlignedBox rhs) const
inline

Tests 2 boxes for inequality.

bool blub::axisAlignedBox::operator== ( const axisAlignedBox rhs) const
inline

Tests 2 boxes for equality.

void blub::axisAlignedBox::scale ( const vector3 s)
inline

Scales the AABB by the vector given.

void blub::axisAlignedBox::setExtents ( const vector3 min,
const vector3 max 
)
inline

Sets both minimum and maximum extents at once.

void blub::axisAlignedBox::setInfinite ( )
inline

Sets the box to 'infinite'

void blub::axisAlignedBox::setMaximum ( const vector3 vec)
inline

Sets the maximum corner of the box.

void blub::axisAlignedBox::setMaximumX ( real  x)
inline

Changes one of the components of the maximum corner of the box used to resize only one dimension of the box

void blub::axisAlignedBox::setMinimum ( const vector3 vec)
inline

Sets the minimum corner of the box.

void blub::axisAlignedBox::setMinimumX ( real  x)
inline

Changes one of the components of the minimum corner of the box used to resize only one dimension of the box

void blub::axisAlignedBox::setNull ( )
inline

Sets the box to a 'null' value i.e. not a box.


The documentation for this class was generated from the following files: