Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::AABox Class Reference

An axis-aligned box. More...

#include <AABox.h>

List of all members.

Public Member Functions

 AABox (const Vector3 &low, const Vector3 &high)
 AABox (const Vector3 &v)
 AABox ()
float area () const
Vector3 center () const
bool contains (const Vector3 &point) const
bool contains (const AABox &other) const
bool culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex=dummy, const uint32 testMask=0xFFFFFFFF) const
bool culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex, const uint32 testMask, uint32 &childMask) const
void deserialize (class BinaryInput &b)
Vector3 extent () const
double extent (int a) const
void getBounds (AABox &out) const
size_t hashCode () const
const Vector3high () const
AABox intersect (const AABox &other) const
bool intersects (const class Sphere &other) const
bool intersects (const AABox &other) const
const Vector3low () const
void merge (const Vector3 &a)
void merge (const AABox &a)
bool operator!= (const AABox &b) const
AABox operator+ (const Vector3 &v) const
AABox operator- (const Vector3 &v) const
bool operator== (const AABox &b) const
Vector3 randomInteriorPoint () const
Vector3 randomSurfacePoint () const
void serialize (class BinaryOutput &b) const
void set (const Vector3 &low, const Vector3 &high)
void split (const Vector3::Axis &axis, float location, AABox &low, AABox &high) const
float volume () const

Static Public Member Functions

static const AABoxinf ()
static const AABoxmaxFinite ()
static const AABoxzero ()


Detailed Description

An axis-aligned box.


Constructor & Destructor Documentation

G3D::AABox::AABox (  )  [inline]

Does not initialize the fields.

G3D::AABox::AABox ( const Vector3 v  )  [inline, explicit]

Constructs a zero-area AABox at v.

G3D::AABox::AABox ( const Vector3 low,
const Vector3 high 
) [inline]

Assumes that low is less than or equal to high along each dimension.

To have this automatically enforced, use AABox(low.min(high), low.max(high));


Member Function Documentation

float G3D::AABox::area (  )  const [inline]

Vector3 G3D::AABox::center (  )  const [inline]

Returns the centroid of the box.

bool G3D::AABox::contains ( const Vector3 point  )  const [inline]

bool G3D::AABox::contains ( const AABox other  )  const [inline]

less than or equal to containment

bool G3D::AABox::culledBy ( const Array< Plane > &  plane,
int32 cullingPlaneIndex = dummy,
const uint32  testMask = 0xFFFFFFFF 
) const

Conservative culling test that does not produce a mask for children.

bool G3D::AABox::culledBy ( const Array< Plane > &  plane,
int32 cullingPlaneIndex,
const uint32  testMask,
uint32 childMask 
) const

Conservative culling test for up to 32 planes.

Returns true if there exists a plane[p] for which the entire object is in the negative half space (opposite the plane normal).

testMask and childMask are used for optimizing bounding volume hierarchies. The version of this method that produces childMask is slower than the version without; it should only be used for parent nodes.

Parameters:
cullingPlaneIndex The index of the first plane for which the entire object is in the negative half-space. The function exits early when one plane is found. -1 when the function returns false (i.e. when no plane culls the whole object).
testMask If bit p is 0, the bounding volume automatically passes the culling test for plane[p] (i.e. it is known that the volume is entirely within the positive half space). The function must return false if testMask is 0 and test all planes when testMask is -1 (0xFFFFFFFF).
childMask Test mask for the children of this volume.

void G3D::AABox::deserialize ( class BinaryInput b  ) 

Vector3 G3D::AABox::extent (  )  const [inline]

double G3D::AABox::extent ( int  a  )  const [inline]

Distance from corner(0) to the next corner along axis a.

void G3D::AABox::getBounds ( AABox out  )  const [inline]

size_t G3D::AABox::hashCode (  )  const [inline]

const Vector3& G3D::AABox::high (  )  const [inline]

static const AABox& G3D::AABox::inf (  )  [inline, static]

AABox G3D::AABox::intersect ( const AABox other  )  const [inline]

Return the intersection of the two boxes.

bool G3D::AABox::intersects ( const class Sphere other  )  const

Returns true if there is any overlap.

Referenced Code:
Jim Arvo's algorithm from Graphics Gems II

bool G3D::AABox::intersects ( const AABox other  )  const

Returns true if there is any overlap.

const Vector3& G3D::AABox::low (  )  const [inline]

static const AABox& G3D::AABox::maxFinite (  )  [inline, static]

The largest possible finite box.

void G3D::AABox::merge ( const Vector3 a  )  [inline]

void G3D::AABox::merge ( const AABox a  )  [inline]

Grows to include the bounds of a.

bool G3D::AABox::operator!= ( const AABox b  )  const [inline]

AABox G3D::AABox::operator+ ( const Vector3 v  )  const [inline]

AABox G3D::AABox::operator- ( const Vector3 v  )  const [inline]

bool G3D::AABox::operator== ( const AABox b  )  const [inline]

Vector3 G3D::AABox::randomInteriorPoint (  )  const

Vector3 G3D::AABox::randomSurfacePoint (  )  const

void G3D::AABox::serialize ( class BinaryOutput b  )  const

void G3D::AABox::set ( const Vector3 low,
const Vector3 high 
) [inline]

Assumes that low is less than or equal to high along each dimension.

void G3D::AABox::split ( const Vector3::Axis axis,
float  location,
AABox low,
AABox high 
) const

Splits the box into two AABoxes along the specified axis.

low contains the part that was closer to negative infinity along axis, high contains the other part. Either may have zero volume.

float G3D::AABox::volume (  )  const [inline]

static const AABox& G3D::AABox::zero (  )  [inline, static]


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:44 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo