Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

box3 Struct Reference

List of all members.

Detailed Description

A three-dimensional bounding box.


Public Member Functions

void set (vec3 min, vec3 max)
 Assign specific values.

vec3 center ()
 Return the center of the box.

void center (vec3 value)
 Change the center of the box.

bit concontains (vec3 point)
 Return whether this point is conservatively within the box.

bit concontains (box3 box)
 Return whether this box conservatively envelopes b (greater than rather than greater than or equal to) .

bit conoverlaps (box3 box)
 Return whether the box conservatively overlaps the other box.

bit contains (vec3 point)
 Return whether the point is within the box.

bit contains (box3 box)
 Return whether this box fully envelopes b.

vec3 dim ()
 Get the dimensions of the box.

void dim (vec3 value)
 Alter the dimensions of the box without changing the center.

void ensure (vec3 point)
 Ensure that the bounds contain this point.

void ensure (box3 box)
 Ensure that the bounds contain this box.

bit isnan ()
 Return whether this is an uninitialised box.

bit overlaps (box3 box)
 Return whether this box overlaps the other box.

bit overlaps (sphere3 sphere)
 Return whether the sphere overlaps or is within the box.

bit overlaps (obb3 obb)
 Return whether the oriented bounding box overlaps or is within the box.

vec3 nearestPoint (vec3 vector)
 Return the nearest point in the box to the vector.

vec3 corner (uint index)
 Return an indexed corner of the box.

sphere3 toSphere ()
 Return the sphere that encapsulates the box.

char[] toString ()
 Convert to string.

Operator overloading.
box3 add (vec3 value)
 box3 = (box3 + vec3)

box3 addass (vec3 value)
 box3 = (box3 += vec3)

box3 sub (vec3 value)
 box3 = (box3 - vec3)

box3 subass (vec3 value)
 box3 = (box3 -= vec3)


Static Public Member Functions

box3 create (vec3 vector)
 Create the box with a specific value.

box3 create (vec3 min, vec3 max)
 Create a box with specific values.

box3 fromCenter (vec3 center, vec3 length)
 Create a box by specifying the center and the length of each side.


Public Attributes

vec3 min
 Starting bounds.

vec3 max
 Ending bounds.


Related Functions

(Note that these are not member functions.)

box3 abox3 (vec3 vector)
 Create a box with a specific bound.

box3 abox3 (vec3 min, vec3 max)
 Create a box with specific bounds.


Member Function Documentation

vec3 box3.corner uint  index  ) 
 

Return an indexed corner of the box.

Parameters:
index The corner index, from 0 to 7. Out-of-range values return NAN.
Returns:
The corner.

bit box3.overlaps obb3  obb  ) 
 

Return whether the oriented bounding box overlaps or is within the box.

Parameters:
obb The oriented bounding box to compare against.
Returns:
Whether this oriented bounding box overlaps the box.

bit box3.overlaps sphere3  sphere  ) 
 

Return whether the sphere overlaps or is within the box.

Parameters:
sphere The sphere to compare against.
Returns:
Whether this sphere overlaps the box.

sphere3 box3.toSphere  ) 
 

Return the sphere that encapsulates the box.

Returns:
The sphere that encapsulates the box. If the box is nan, the sphere is nan.


The documentation for this struct was generated from the following file:
Generated on Thu Sep 4 13:12:51 2003 for dig by doxygen 1.3.2