QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Maths::Box3f Struct Reference
[Box3]

#include <Q/maths.h>

List of all members.

Public Member Functions

 Box3f ()
 Box3f (float minx, float miny, float minz, float maxx, float maxy, float maxz)
 Box3f (const Vec3f &vmin, const Vec3f &vmax)
Vec3f centre () const
Vec3f dimensions () const
void intersect (const Box3f &b)
void add (const Box3f &b)
void add (const Vec3f &p)
bool operator== (const Box3f &box) const
bool operator!= (const Box3f &box) const
int operator<= (const Box3f &) const
bool equal (const Box3f &b, float e=Epsilon) const
bool contains (const Box3f &b) const
bool contains (const Vec3f &p) const
bool intersects (const Box3f &b) const
bool intersects (const Sphere3f &s) const
bool intersects (const Rayf &r, float &rayMin, float &rayMax) const
bool intersects (const Vec3f *v, unsigned int vCount) const
void invalidate ()
bool valid () const
Box3f transform (const Matrix4f &mat) const
Box3f inverseTransform (const Matrix4f &mat) const
Box3f expandBy (float delta) const
Vec3foperator[] (int i)
const Vec3foperator[] (int i) const

Public Attributes

Vec3f bmin
Vec3f bmax


Detailed Description

3D Box definition and manipulation.


Constructor & Destructor Documentation

Maths::Box3f::Box3f  )  [inline]
 

Create a new uninitialised box.

Maths::Box3f::Box3f float  minx,
float  miny,
float  minz,
float  maxx,
float  maxy,
float  maxz
[inline]
 

Create a box with corners (minx,miny,minz) and (maxx,maxy,maxz)

Maths::Box3f::Box3f const Vec3f vmin,
const Vec3f vmax
[inline]
 

Create a box with corners vmin and vmax


Member Function Documentation

void Maths::Box3f::add const Vec3f p  ) 
 

Change this box to be the union of this box and the point p.

void Maths::Box3f::add const Box3f b  ) 
 

Change this box to be the union of this box and box b.

Vec3f Maths::Box3f::centre  )  const [inline]
 

Return the centre point of the box.

bool Maths::Box3f::contains const Vec3f p  )  const
 

Return whether the point p is inside the box.

bool Maths::Box3f::contains const Box3f b  )  const
 

Return whether the box b is wholly contained within this box.

Vec3f Maths::Box3f::dimensions  )  const [inline]
 

Return the dimensions of the box.

bool Maths::Box3f::equal const Box3f b,
float  e = Epsilon
const
 

Return whether this box is equal to b, within e in each dimension.

Box3f Maths::Box3f::expandBy float  delta  )  const
 

Return the box that is this box expanded by delta units in all directions.

void Maths::Box3f::intersect const Box3f b  ) 
 

Change this box to be the intersection of this box and box b.

bool Maths::Box3f::intersects const Vec3f v,
unsigned int  vCount
const
 

Return whether the polygon defined by the array v of size vCount intersects the box.

bool Maths::Box3f::intersects const Rayf r,
float &  rayMin,
float &  rayMax
const
 

Return whether this box is intersected by the ray r and that the intersection happens between the distances rayMin and rayMax along the ray from its origin. rayMin may be increased by the function to indicate the actual position along the ray at which it entered the box. rayMax maybe be decreased by the function to indicate the actual position along the ray at which it left the box.

bool Maths::Box3f::intersects const Sphere3f s  )  const
 

Return whether this box is intersected by the sphere s.

bool Maths::Box3f::intersects const Box3f b  )  const
 

Return whether this box is intersected by the box b.

void Maths::Box3f::invalidate  ) 
 

Turns the box inside out, so that it can be used to accumulate results.

Box3f Maths::Box3f::inverseTransform const Matrix4f mat  )  const
 

Return the box that is this box, inverse transformed by the Matrix4f mat.

const Vec3f& Maths::Box3f::operator[] int  i  )  const [inline]
 

If i is 0, return bmin, if i is 1, return bmax

Vec3f& Maths::Box3f::operator[] int  i  )  [inline]
 

If i is 0, return bmin, if i is 1, return bmax

Box3f Maths::Box3f::transform const Matrix4f mat  )  const
 

Return the box that is this box, transformed by the Matrix4f mat.

bool Maths::Box3f::valid  )  const
 

Return whether the box is valid. A box is invalid if bmax < bmin.


Member Data Documentation

Vec3f Maths::Box3f::bmax
 

The maximum point of the box in all axes.

Vec3f Maths::Box3f::bmin
 

The minimum point of the box in all axes.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004