Box3I Class Reference

#include <mBox.h>

List of all members.


Detailed Description

Bounding Box.

A helper class for working with boxes. It runs at F32 precision.

See also:
Box3D


Public Member Functions

 Box3I ()
 Box3I (const Point3I &in_rMin, const Point3I &in_rMax, const bool in_overrideCheck=false)
 Create a box from two points.
 Box3I (S32 xmin, S32 ymin, S32 zmin, S32 max, S32 ymax, S32 zmax)
 Create a box from six extent values.
bool isContained (const Point3I &in_rContained) const
 Check to see if a point is contained in this box.
bool isOverlapped (const Box3I &in_rOverlap) const
 Check to see if another box overlaps this box.
bool isContained (const Box3I &in_rContained) const
 Check to see if another box is contained in this box.
S32 len_x () const
S32 len_y () const
S32 len_z () const
void intersect (const Box3I &in_rIntersect)
 Perform an intersection operation with another box and store the results in this box.
void getCenter (Point3I *center) const
 Get the center of this box.
bool isValidBox () const
 Check that the box is valid.
void extend (const Point3I &p)

Public Attributes

Point3I minExtents
 Minimum extents of box.
Point3I maxExtents
 Maximum extents of box.


Constructor & Destructor Documentation

Box3I::Box3I (  )  [inline]

Box3I::Box3I ( const Point3I in_rMin,
const Point3I in_rMax,
const bool  in_overrideCheck = false 
) [inline]

Create a box from two points.

Normally, this function will compensate for mismatched min/max values. If you know your values are valid, you can set in_overrideCheck to true and skip this.

Parameters:
in_rMin Minimum extents of box.
in_rMax Maximum extents of box.
in_overrideCheck Pass true to skip check of extents.

Box3I::Box3I ( S32  xmin,
S32  ymin,
S32  zmin,
S32  max,
S32  ymax,
S32  zmax 
) [inline]

Create a box from six extent values.

No checking is performed as to the validity of these extents, unlike the other constructor.


Member Function Documentation

bool Box3I::isContained ( const Point3I in_rContained  )  const [inline]

Check to see if a point is contained in this box.

bool Box3I::isOverlapped ( const Box3I in_rOverlap  )  const [inline]

Check to see if another box overlaps this box.

bool Box3I::isContained ( const Box3I in_rContained  )  const [inline]

Check to see if another box is contained in this box.

S32 Box3I::len_x (  )  const [inline]

S32 Box3I::len_y (  )  const [inline]

S32 Box3I::len_z (  )  const [inline]

void Box3I::intersect ( const Box3I in_rIntersect  )  [inline]

Perform an intersection operation with another box and store the results in this box.

void Box3I::getCenter ( Point3I center  )  const [inline]

Get the center of this box.

This is the average of min and max.

bool Box3I::isValidBox (  )  const [inline]

Check that the box is valid.

Currently, this just means that min < max.

void Box3I::extend ( const Point3I p  )  [inline]


Member Data Documentation

Minimum extents of box.

Maximum extents of box.