Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

vhdAxisAlignedBox Class Reference

A 3D box aligned with the x/y/z axes. More...

#include <vhdAxisAlignedBox.h>

Collaboration diagram for vhdAxisAlignedBox:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 vhdAxisAlignedBox (float mx, float my, float mz, float Mx, float My, float Mz)
vhdVector3 getMinimum (void) const
vhdVector3 getMaximum (void) const
void setExtents (float mx, float my, float mz, float Mx, float My, float Mz)

Protected Member Functions

void _updateCorners (void)

Protected Attributes

vhdVector3 _vecMinimum
vhdVector3 _vecMaximum
bool _bNull
vhdVector3 _vecCorners [8]

Friends

std::ostream & operator<< (std::ostream &o, vhdAxisAlignedBox aab)

Detailed Description

A 3D box aligned with the x/y/z axes.

This class represents a simple box which is aligned with the axes. Internally it only stores 2 points as the extremeties of the box, one which is the minima of all 3 axes, and the other which is the maxima of all 3 axes. This class is typically used for an axis-aligned bounding box (AABB) for collision and visibility determination.

Author:
Sebastien Schertenleib Sebastien.Schertenleib@epfl.ch
Version:
0.0.1

Definition at line 45 of file vhdAxisAlignedBox.h.


Member Function Documentation

void vhdAxisAlignedBox::_updateCorners (  void   )  [inline, protected]
 

Internal method for updating corner points. Definition at line 98 of file vhdAxisAlignedBox.h.

References vhdVector3::x, vhdVector3::y, and vhdVector3::z.

Referenced by setExtents().

vhdVector3 vhdAxisAlignedBox::getMaximum (  void   )  const [inline]
 

Gets the maximum corner of the box.

Returns:
the maximum corner of the box.
Definition at line 142 of file vhdAxisAlignedBox.h.

vhdVector3 vhdAxisAlignedBox::getMinimum (  void   )  const [inline]
 

Gets the minimum corner of the box.

Returns:
the minimum corner of the box.
Definition at line 131 of file vhdAxisAlignedBox.h.

void vhdAxisAlignedBox::setExtents (  float  mx,
float  my,
float  mz,
float  Mx,
float  My,
float  Mz
)  [inline]
 

Sets both minimum and maximum extents at once.

mx the minimum x corner of the box. my the minimum y corner of the box. mz the minimum z corner of the box. Mx the maximum x corner of the box. My the maximum y corner of the box. Mz the maximum z corner of the box. Definition at line 159 of file vhdAxisAlignedBox.h.

References _updateCorners(), vhdVector3::x, vhdVector3::y, and vhdVector3::z.


Generated on Sun Oct 3 16:32:22 2004 for vhdABTTree by doxygen 1.3.8