AABB Class Reference

3-Dimensional Axis-Aligned Bounding Box More...

#include <AABB.h>

Inheritance diagram for AABB:

SSEAligned

List of all members.

Public Member Functions

Constructors
 AABB ()
 AABB (const Vector3 &min_, const Vector3 &max_)
Main usage interface
bool intersects (const Ray &ray, real_t &tMin, real_t &tMax) const
void add (const Vector3 &v)
 unions this AABB with the given vector
void add (const Point3 &p)
 unions this AABB with the given Point
void add (const AABB &aabb)
 unions this AABB with the given AABB
bool intersects (const AABB &aabb) const
bool contains (const Point3 &p) const
void preview () const
Accessors
Vector3 getDiagonal () const
Point3 getCenter () const
unsigned getMaxExtent () const
unsigned getMinExtent () const
real_t getSurfaceArea () const
void getMinMaxSurfaceArea (const unsigned axis, const real_t pos, real_t &leftArea, real_t &rightArea) const
AABB getTransformed (const Matrix4x4 &trans) const
bool isValid () const
bool isPoint () const

Public Attributes

Vector3 min
Vector3 max


Detailed Description

3-Dimensional Axis-Aligned Bounding Box

Author:
Travis Fischer (fisch0920@gmail.com)
Date:
Fall 2008

Definition at line 18 of file AABB.h.


Constructor & Destructor Documentation

AABB::AABB (  )  [inline]

Definition at line 25 of file AABB.h.

AABB::AABB ( const Vector3 min_,
const Vector3 max_ 
) [inline]

Definition at line 29 of file AABB.h.


Member Function Documentation

bool AABB::intersects ( const Ray ray,
real_t tMin,
real_t tMax 
) const [inline]

Ray-box intersection using IEEE numerical properties to ensure that the test is both robust and efficient, as described in:

Amy Williams, Steve Barrus, R. Keith Morley, and Peter Shirley "An Efficient and Robust Ray-Box Intersection Algorithm" Journal of graphics tools, 10(1):49-54, 2005

Modified slightly by for the purposes of this program

Definition at line 23 of file AABB.inl.

void AABB::add ( const Vector3 v  )  [inline]

unions this AABB with the given vector

Definition at line 56 of file AABB.inl.

void AABB::add ( const Point3 p  )  [inline]

unions this AABB with the given Point

Definition at line 61 of file AABB.inl.

void AABB::add ( const AABB aabb  )  [inline]

unions this AABB with the given AABB

Definition at line 65 of file AABB.inl.

bool AABB::intersects ( const AABB aabb  )  const [inline]

Returns:
whether or not this AABB intersects the given AABB
Note:
inclusive with respect to boundaries

Definition at line 72 of file AABB.inl.

bool AABB::contains ( const Point3 p  )  const [inline]

Returns:
whether or not this AABB contains the given point
Note:
inclusive with respect to boundaries of AABB

Definition at line 80 of file AABB.inl.

void AABB::preview (  )  const

Definition at line 11 of file AABB.cpp.

Vector3 AABB::getDiagonal (  )  const [inline]

Returns:
the diagonal of this AABB

Definition at line 86 of file AABB.inl.

Point3 AABB::getCenter (  )  const [inline]

Definition at line 90 of file AABB.inl.

unsigned AABB::getMaxExtent (  )  const [inline]

Returns:
the dominant (longest) axis along this AABB

Definition at line 94 of file AABB.inl.

unsigned AABB::getMinExtent (  )  const [inline]

Returns:
the shortest axis along this AABB

Definition at line 102 of file AABB.inl.

real_t AABB::getSurfaceArea (  )  const [inline]

Returns:
the surface area of this AABB

Definition at line 110 of file AABB.inl.

void AABB::getMinMaxSurfaceArea ( const unsigned  axis,
const real_t  pos,
real_t leftArea,
real_t rightArea 
) const [inline]

Returns:
the surface area of the child AABBs split along the specified at
Note:
this is used extensively by the SAH kd-Tree

Definition at line 118 of file AABB.inl.

AABB AABB::getTransformed ( const Matrix4x4 trans  )  const [inline]

Returns:
the tightest-fitting AABB after undergoing a transformation

Definition at line 136 of file AABB.inl.

bool AABB::isValid (  )  const [inline]

Returns:
true if this AABB has been initialized with a min <= max
Note:
will be valid if 'min' is less than or equal to 'max'

Definition at line 168 of file AABB.inl.

bool AABB::isPoint (  )  const [inline]

Returns:
true if this AABB represents a single point (min == max)
Note:
will be valid if 'min' is strictly less than 'max'

Definition at line 172 of file AABB.inl.


Member Data Documentation

Definition at line 19 of file AABB.h.

Definition at line 20 of file AABB.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6