Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Emma::Box3f Class Reference

#include <EmmaBox3f.h>

List of all members.

Public Member Functions

EMMA_EXPORT Box3f ()
 Default constructor - leaves box totally empty.
EMMA_EXPORT Box3f (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
 Constructor given bounds.
EMMA_EXPORT Box3f (const Fusion::Vec3f &_min, const Fusion::Vec3f &_max)
 Constructor given minimum and maximum points.
EMMA_EXPORT ~Box3f ()
EMMA_EXPORT const Fusion::Vec3fgetMin () const
 Returns the min and max points.
EMMA_EXPORT const Fusion::Vec3fgetMax () const
EMMA_EXPORT Fusion::Vec3fgetMin ()
EMMA_EXPORT Fusion::Vec3fgetMax ()
EMMA_EXPORT Fusion::Vec3f getCenter () const
 Returns the center of a box.
EMMA_EXPORT void extendBy (const Fusion::Vec3f &pt)
 Extends Box3f (if necessary) to contain given 3D point.
EMMA_EXPORT void extendBy (const Box3f &bb)
 Extends Box3f (if necessary) to contain given Box3f.
EMMA_EXPORT bool intersect (const Fusion::Vec3f &pt) const
 Returns TRUE if intersection of given point and Box3f is not empty.
EMMA_EXPORT bool intersect (const Box3f &bb) const
 Returns TRUE if intersection of given Box3f and Box3f is not empty.
EMMA_EXPORT bool outside (const Matrix &MVP, int &cullBits) const
 Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projection matrix given.
EMMA_EXPORT void setBounds (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
 Common get and set functions.
EMMA_EXPORT void setBounds (const Fusion::Vec3f &_min, const Fusion::Vec3f &_max)
EMMA_EXPORT void getBounds (float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
EMMA_EXPORT void getBounds (Fusion::Vec3f &_min, Fusion::Vec3f &_max) const
EMMA_EXPORT Fusion::Vec3f getClosestPoint (const Fusion::Vec3f &point)
 Returns the closest point on the box to the given point.
EMMA_EXPORT void getOrigin (float &originX, float &originY, float &originZ) const
 Returns origin (minimum point) of box.
EMMA_EXPORT void getSize (float &sizeX, float &sizeY, float &sizeZ) const
 Returns size of box.
EMMA_EXPORT void makeEmpty ()
 Sets Box3f to contain nothing.
EMMA_EXPORT bool isEmpty () const
 Checks if the box is empty (degenerate) note that this relies on boxes being completely degenerate if they are degenerate at all.
EMMA_EXPORT bool hasVolume () const
 Checks if the box has volume; i.e.
EMMA_EXPORT void getSpan (const Fusion::Vec3f &direction, float &dMin, float &dMax) const
 Finds the extent of a box along a particular direction.
EMMA_EXPORT void transform (const Matrix &m)
 Transforms Box3f by matrix, enlarging Box3f to contain result.
EMMA_EXPORT float getVolume () const
 Gives the volume of the box (0 for an empty box).

Friends

FUSION_EXPORT friend int operator== (const Box3f &b1, const Box3f &b2)
 Equality comparisons.
FUSION_EXPORT friend int operator!= (const Box3f &b1, const Box3f &b2)


Constructor & Destructor Documentation

EMMA_EXPORT Emma::Box3f::Box3f  )  [inline]
 

Default constructor - leaves box totally empty.

EMMA_EXPORT Emma::Box3f::Box3f float  xmin,
float  ymin,
float  zmin,
float  xmax,
float  ymax,
float  zmax
[inline]
 

Constructor given bounds.

EMMA_EXPORT Emma::Box3f::Box3f const Fusion::Vec3f _min,
const Fusion::Vec3f _max
[inline]
 

Constructor given minimum and maximum points.

EMMA_EXPORT Emma::Box3f::~Box3f  )  [inline]
 


Member Function Documentation

EMMA_EXPORT void Emma::Box3f::extendBy const Box3f bb  ) 
 

Extends Box3f (if necessary) to contain given Box3f.

EMMA_EXPORT void Emma::Box3f::extendBy const Fusion::Vec3f pt  ) 
 

Extends Box3f (if necessary) to contain given 3D point.

EMMA_EXPORT void Emma::Box3f::getBounds Fusion::Vec3f _min,
Fusion::Vec3f _max
const [inline]
 

EMMA_EXPORT void Emma::Box3f::getBounds float &  xmin,
float &  ymin,
float &  zmin,
float &  xmax,
float &  ymax,
float &  zmax
const [inline]
 

EMMA_EXPORT Fusion::Vec3f Emma::Box3f::getCenter  )  const
 

Returns the center of a box.

EMMA_EXPORT Fusion::Vec3f Emma::Box3f::getClosestPoint const Fusion::Vec3f point  ) 
 

Returns the closest point on the box to the given point.

(Returns the point on the center of the Z face if passed the center.)

EMMA_EXPORT Fusion::Vec3f& Emma::Box3f::getMax  )  [inline]
 

EMMA_EXPORT const Fusion::Vec3f& Emma::Box3f::getMax  )  const [inline]
 

EMMA_EXPORT Fusion::Vec3f& Emma::Box3f::getMin  )  [inline]
 

EMMA_EXPORT const Fusion::Vec3f& Emma::Box3f::getMin  )  const [inline]
 

Returns the min and max points.

EMMA_EXPORT void Emma::Box3f::getOrigin float &  originX,
float &  originY,
float &  originZ
const [inline]
 

Returns origin (minimum point) of box.

EMMA_EXPORT void Emma::Box3f::getSize float &  sizeX,
float &  sizeY,
float &  sizeZ
const [inline]
 

Returns size of box.

EMMA_EXPORT void Emma::Box3f::getSpan const Fusion::Vec3f direction,
float &  dMin,
float &  dMax
const
 

Finds the extent of a box along a particular direction.

EMMA_EXPORT float Emma::Box3f::getVolume  )  const
 

Gives the volume of the box (0 for an empty box).

EMMA_EXPORT bool Emma::Box3f::hasVolume  )  const [inline]
 

Checks if the box has volume; i.e.

, all three dimensions have positive size

EMMA_EXPORT bool Emma::Box3f::intersect const Box3f bb  )  const
 

Returns TRUE if intersection of given Box3f and Box3f is not empty.

EMMA_EXPORT bool Emma::Box3f::intersect const Fusion::Vec3f pt  )  const
 

Returns TRUE if intersection of given point and Box3f is not empty.

EMMA_EXPORT bool Emma::Box3f::isEmpty  )  const [inline]
 

Checks if the box is empty (degenerate) note that this relies on boxes being completely degenerate if they are degenerate at all.

All member functions preserve this invariant.

EMMA_EXPORT void Emma::Box3f::makeEmpty  ) 
 

Sets Box3f to contain nothing.

EMMA_EXPORT bool Emma::Box3f::outside const Matrix MVP,
int &  cullBits
const
 

Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projection matrix given.

"cullBits" keeps track of which view-volume clipping planes the box is completely inside of; if a 'parent' bounding box of this bounding box was found to be completely inside the left/right clipping planes, the low bit of cullBits will be set to zero, and this routine will not test this box against those planes. When cullBits is zero, it is a waste of time to call this function! Before calling this the first time, set cullBits to 7

EMMA_EXPORT void Emma::Box3f::setBounds const Fusion::Vec3f _min,
const Fusion::Vec3f _max
[inline]
 

EMMA_EXPORT void Emma::Box3f::setBounds float  xmin,
float  ymin,
float  zmin,
float  xmax,
float  ymax,
float  zmax
[inline]
 

Common get and set functions.

EMMA_EXPORT void Emma::Box3f::transform const Matrix m  ) 
 

Transforms Box3f by matrix, enlarging Box3f to contain result.


Friends And Related Function Documentation

FUSION_EXPORT friend int operator!= const Box3f b1,
const Box3f b2
[friend]
 

FUSION_EXPORT friend int operator== const Box3f b1,
const Box3f b2
[friend]
 

Equality comparisons.


The documentation for this class was generated from the following file:
Generated on Sat Apr 1 06:08:21 2006 for Emma SDK Guide by  doxygen 1.4.3