Contents Functions Classes Topics User Forum CVS

G3D::Box Class Reference

#include <Box.h>

List of all members.

Public Member Functions

 Box ()
 Box (const Vector3 &min, const Vector3 &max)
 Box (class BinaryInput &b)
 Box (const class AABox &b)
void serialize (class BinaryOutput &b) const
void deserialize (class BinaryInput &b)
CoordinateFrame localFrame () const
void getLocalFrame (CoordinateFrame &frame) const
Vector3 center () const
Vector3 getCenter () const
Vector3 getCorner (int i) const
Vector3 corner (int i) const
Vector3 axis (int a) const
float extent (int a) const
Vector3 extent () const
void getFaceCorners (int f, Vector3 &v0, Vector3 &v1, Vector3 &v2, Vector3 &v3) const
bool culledBy (const class Plane *plane, int numPlanes, int32 &cullingPlaneIndex, const uint32 testMask, uint32 &childMask) const
bool culledBy (const class Plane *plane, int numPlanes, int32 &cullingPlaneIndex=dummy, const uint32 testMask=-1) const
bool culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex, const uint32 testMask, uint32 &childMask) const
bool culledBy (const Array< Plane > &plane, int32 &cullingPlaneIndex=dummy, const uint32 testMask=-1) const
bool contains (const Vector3 &point) const
float surfaceArea () const
float area () const
float volume () const
void getRandomSurfacePoint (Vector3 &P, Vector3 &N=Vector3::dummy) const
Vector3 randomSurfacePoint () const
Vector3 randomInteriorPoint () const
void getBounds (class AABox &) const

Friends

class CoordinateFrame


Detailed Description

An arbitrary 3D box, useful as a bounding box.

To construct a box from a coordinate frame, center and extent, use the idiom:

Box box = cframe.toObjectSpace(Box(center - extent/2, center + extent/2));


Constructor & Destructor Documentation

G3D::Box::Box  ) 
 

Does not initialize the fields.

G3D::Box::Box const Vector3 min,
const Vector3 max
 

Constructs a box from two opposite corners.

G3D::Box::Box class BinaryInput b  ) 
 

G3D::Box::Box const class AABox b  ) 
 


Member Function Documentation

float G3D::Box::area  )  const [inline]
 

Vector3 G3D::Box::axis int  a  )  const [inline]
 

Unit length.

Vector3 G3D::Box::center  )  const [inline]
 

Returns the centroid of the box.

bool G3D::Box::contains const Vector3 point  )  const
 

Vector3 G3D::Box::corner int  i  )  const [inline]
 

bool G3D::Box::culledBy const Array< Plane > &  plane,
int32 cullingPlaneIndex = dummy,
const uint32  testMask = -1
const
 

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

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

See AABox::culledBy

bool G3D::Box::culledBy const class Plane plane,
int  numPlanes,
int32 cullingPlaneIndex = dummy,
const uint32  testMask = -1
const
 

Deprecated:
Use culledBy(Array<Plane>&)

bool G3D::Box::culledBy const class Plane plane,
int  numPlanes,
int32 cullingPlaneIndex,
const uint32  testMask,
uint32 childMask
const
 

Deprecated:
Use culledBy(Array<Plane>&)

void G3D::Box::deserialize class BinaryInput b  ) 
 

Vector3 G3D::Box::extent  )  const [inline]
 

float G3D::Box::extent int  a  )  const [inline]
 

Distance from corner(0) to the next corner along the box's local axis a.

void G3D::Box::getBounds class AABox  )  const
 

Vector3 G3D::Box::getCenter  )  const [inline]
 

Vector3 G3D::Box::getCorner int  i  )  const [inline]
 

Returns a corner (0 <= i < 8)

Deprecated:

void G3D::Box::getFaceCorners int  f,
Vector3 v0,
Vector3 v1,
Vector3 v2,
Vector3 v3
const
 

Returns the four corners of a face (0 <= f < 6). The corners are returned to form a counter clockwise quad facing outwards.

void G3D::Box::getLocalFrame CoordinateFrame frame  )  const
 

void G3D::Box::getRandomSurfacePoint Vector3 P,
Vector3 N = Vector3::dummy
const
 

CoordinateFrame G3D::Box::localFrame  )  const
 

Returns the object to world transformation for this box. localFrame().worldToObject(...) takes objects into the space where the box axes are (1,0,0), (0,1,0), (0,0,1). Note that there is no scaling in this transformation.

Vector3 G3D::Box::randomInteriorPoint  )  const
 

Uniformly distributed on the interior (includes surface)

Vector3 G3D::Box::randomSurfacePoint  )  const [inline]
 

Deprecated:
Uniformly distributed on the surface.

void G3D::Box::serialize class BinaryOutput b  )  const
 

float G3D::Box::surfaceArea  )  const
 

Deprecated:

float G3D::Box::volume  )  const
 


Friends And Related Function Documentation

friend class CoordinateFrame [friend]
 


The documentation for this class was generated from the following file:
Generated on Mon Jul 17 11:50:45 2006 for G3D by doxygen 1.4.5
Hosted by SourceForge.net Logo