Public Member Functions | Public Attributes

gmtl::OOBox Class Reference

#include <OOBox.h>

List of all members.

Public Member Functions

 OOBox ()
 OOBox (OOBox &box)
Point3 & center ()
const Point3 & center () const
Vec3 & axis (int i)
const Vec3 & axis (int i) const
Vec3 * axes ()
const Vec3 * axes () const
float & halfLen (int i)
const float & halfLen (int i) const
float * halfLens ()
const float * halfLens () const
OOBoxoperator= (const OOBox &box)
bool operator== (const OOBox &box) const
void getVerts (Point3 verts[8]) const
void mergeWith (const OOBox &box)
void ident ()

Public Attributes

Point3 mCenter
Vec3 mAxis [3]
float mHalfLen [3]

Detailed Description

Definition at line 19 of file OOBox.h.


Constructor & Destructor Documentation

gmtl::OOBox::OOBox (  )  [inline]

Definition at line 23 of file OOBox.h.

   { ident(); }

gmtl::OOBox::OOBox ( OOBox box  )  [inline]

Definition at line 77 of file OOBox.h.

{
   mCenter = box.mCenter;
   mAxis[0] = box.mAxis[0];
   mAxis[1] = box.mAxis[1];
   mAxis[2] = box.mAxis[2];
   mHalfLen[0] = box.mHalfLen[0];
   mHalfLen[1] = box.mHalfLen[1];
   mHalfLen[2] = box.mHalfLen[2];
}


Member Function Documentation

Vec3 * gmtl::OOBox::axes (  )  [inline]

Definition at line 109 of file OOBox.h.

{
   return mAxis;
}

const Vec3 * gmtl::OOBox::axes (  )  const [inline]

Definition at line 114 of file OOBox.h.

{
   return mAxis;
}

Vec3 & gmtl::OOBox::axis ( int  i  )  [inline]

Definition at line 99 of file OOBox.h.

{
   return mAxis[i];
}

const Vec3 & gmtl::OOBox::axis ( int  i  )  const [inline]

Definition at line 104 of file OOBox.h.

{
   return mAxis[i];
}

const Point3 & gmtl::OOBox::center (  )  const [inline]

Definition at line 94 of file OOBox.h.

{
   return mCenter;
}

Point3 & gmtl::OOBox::center (  )  [inline]

Definition at line 89 of file OOBox.h.

{
   return mCenter;
}

void gmtl::OOBox::getVerts ( Point3  verts[8]  )  const [inline]

Definition at line 164 of file OOBox.h.

{
   Vec3 x_half_axis = mAxis[0]*mHalfLen[0];
   Vec3 y_half_axis = mAxis[1]*mHalfLen[1];
   Vec3 z_half_axis = mAxis[2]*mHalfLen[2];

   verts[0] = mCenter - x_half_axis - y_half_axis - z_half_axis;
   verts[1] = mCenter + x_half_axis - y_half_axis - z_half_axis;
   verts[2] = mCenter + x_half_axis + y_half_axis - z_half_axis;
   verts[3] = mCenter - x_half_axis + y_half_axis - z_half_axis;
   verts[4] = mCenter - x_half_axis - y_half_axis + z_half_axis;
   verts[5] = mCenter + x_half_axis - y_half_axis + z_half_axis;
   verts[6] = mCenter + x_half_axis + y_half_axis + z_half_axis;
   verts[7] = mCenter - x_half_axis + y_half_axis + z_half_axis;
}

const float & gmtl::OOBox::halfLen ( int  i  )  const [inline]

Definition at line 124 of file OOBox.h.

{
   return mHalfLen[i];
}

float & gmtl::OOBox::halfLen ( int  i  )  [inline]

Definition at line 119 of file OOBox.h.

{
   return mHalfLen[i];
}

float * gmtl::OOBox::halfLens (  )  [inline]

Definition at line 129 of file OOBox.h.

{
   return mHalfLen;
}

const float * gmtl::OOBox::halfLens (  )  const [inline]

Definition at line 134 of file OOBox.h.

{
   return mHalfLen;
}

void gmtl::OOBox::ident (  )  [inline]

Definition at line 57 of file OOBox.h.

   {
      mCenter = ZeroVec3;
      mAxis[0] = XUnitVec3;
      mAxis[1] = YUnitVec3;
      mAxis[2] = ZUnitVec3;
      mHalfLen[0] = mHalfLen[1] = mHalfLen[2] = 0.0f;
   }

void gmtl::OOBox::mergeWith ( const OOBox box  ) 
OOBox & gmtl::OOBox::operator= ( const OOBox box  )  [inline]

Definition at line 140 of file OOBox.h.

{
   mCenter = box.mCenter;
   mAxis[0] = box.mAxis[0];
   mAxis[1] = box.mAxis[1];
   mAxis[2] = box.mAxis[2];
   mHalfLen[0] = box.mHalfLen[0];
   mHalfLen[1] = box.mHalfLen[1];
   mHalfLen[2] = box.mHalfLen[2];
   return *this;
}

bool gmtl::OOBox::operator== ( const OOBox box  )  const [inline]

Definition at line 153 of file OOBox.h.

{
   return ((mCenter == box.mCenter) &&
           (mAxis[0] == box.mAxis[0]) &&
           (mAxis[1] == box.mAxis[1]) &&
           (mAxis[2] == box.mAxis[2]) &&
           (mHalfLen[0] == box.mHalfLen[0]) &&
           (mHalfLen[1] == box.mHalfLen[1]) &&
           (mHalfLen[2] == box.mHalfLen[2]));
}


Member Data Documentation

Definition at line 68 of file OOBox.h.

Definition at line 67 of file OOBox.h.

Definition at line 69 of file OOBox.h.


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