Public Methods |
float | MinX () const |
| Get the minimum X value of the box.
|
float | MinY () const |
| Get the minimum Y value of the box.
|
float | MinZ () const |
| Get the minimum Z value of the box.
|
float | MaxX () const |
| Get the maximum X value of the box.
|
float | MaxY () const |
| Get the maximum Y value of the box.
|
float | MaxZ () const |
| Get the maximum Z value of the box.
|
float | Min (int idx) const |
| Get Min component for 0 (x), 1 (y), or 2 (z).
|
float | Max (int idx) const |
| Get Max component for 0 (x), 1 (y), or 2 (z).
|
const csVector3& | Min () const |
| Get the 3d vector of minimum (x, y, z) values.
|
const csVector3& | Max () const |
| Get the 3d vector of maximum (x, y, z) values.
|
csVector3 | GetCorner (int corner) const |
| Return every corner of this bounding box from 0 to 7. More...
|
void | GetEdgeInfo (int edge, int &v1, int &v2, int &fleft, int &fright) const |
| Given an edge index (CS_BOX_EDGE_???) return the two vertices (index CS_BOX_CORNER_???) and left/right faces (CS_BOX_SIDE_???).
|
uint8* | GetFaceEdges (int face) const |
| Given a face index (CS_BOX_SIDE_???) return the four edges oriented clockwise around this face (CS_BOX_EDGE_???).
|
csVector3 | GetCenter () const |
| Get the center of this box.
|
void | SetCenter (const csVector3 &c) |
| Set the center of this box. More...
|
void | SetSize (const csVector3 &s) |
| Set the size of the box but keep the center intact.
|
csBox2 | GetSide (int side) const |
| Get a side of this box as a 2D box. More...
|
int | GetVisibleSides (const csVector3 &pos, int *visible_sides) const |
| Fill the array (which should be three long at least) with all visible sides (CS_BOX_SIDE_??? defines) as seen from the given point. More...
|
csSegment3 | GetEdge (int edge) const |
| Return every edge (segment) of this bounding box from 0 to 23 (use one of the CS_BOX_EDGE_??? indices). More...
|
void | GetEdge (int edge, csSegment3 &e) const |
| Return every edge (segment) of this bounding box from 0 to 23 (use one of the CS_BOX_EDGE_??? indices). More...
|
bool | In (float x, float y, float z) const |
| Test if the given coordinate is in this box.
|
bool | In (const csVector3 &v) const |
| Test if the given coordinate is in this box.
|
bool | Overlap (const csBox3 &box) const |
| Test if this box overlaps with the given box.
|
bool | Contains (const csBox3 &box) const |
| Test if this box contains the other box.
|
bool | Empty () const |
| Test if this box is empty.
|
void | StartBoundingBox () |
| Initialize this box to empty.
|
void | StartBoundingBox (const csVector3 &v) |
| Initialize this box to one vertex.
|
void | AddBoundingVertex (float x, float y, float z) |
| Add a new vertex and recalculate the bounding box.
|
void | AddBoundingVertex (const csVector3 &v) |
| Add a new vertex and recalculate the bounding box.
|
void | AddBoundingVertexSmart (float x, float y, float z) |
| Add a new vertex and recalculate the bounding box. More...
|
void | AddBoundingVertexSmart (const csVector3 &v) |
| Add a new vertex and recalculate the bounding box. More...
|
| csBox3 () |
| Initialize this box to empty.
|
| csBox3 (const csVector3 &v) |
| Initialize this box with one point.
|
| csBox3 (const csVector3 &v1, const csVector3 &v2) |
| Initialize this box with two points.
|
| csBox3 (float x1, float y1, float z1, float x2, float y2, float z2) |
| Initialize this box with the given values.
|
void | Set (const csVector3 &bmin, const csVector3 &bmax) |
| Sets the bounds of the box with the given values.
|
void | Set (float x1, float y1, float z1, float x2, float y2, float z2) |
| Sets the bounds of the box with the given values.
|
bool | AdjacentX (const csBox3 &other) const |
| Test if this box is adjacent to the other on the X side.
|
bool | AdjacentY (const csBox3 &other) const |
| Test if this box is adjacent to the other on the Y side.
|
bool | AdjacentZ (const csBox3 &other) const |
| Test if this box is adjacent to the other on the Z side.
|
int | Adjacent (const csBox3 &other) const |
| Test if this box is adjacent to the other one. More...
|
void | GetConvexOutline (const csVector3 &pos, csVector3 *array, int &num_array, bool bVisible=false) const |
| Get a convex outline (not a polygon unless projected to 2D) for for this box as seen from the given position. More...
|
bool | Between (const csBox3 &box1, const csBox3 &box2) const |
| Test if this box is between two others.
|
void | ManhattanDistance (const csBox3 &other, csVector3 &dist) const |
| Calculate the minimum manhattan distance between this box and another one.
|
float | SquaredOriginDist () const |
| Calculate the squared distance between (0,0,0) and the box This routine is extremely efficient.
|
float | SquaredOriginMaxDist () const |
| Calculate the squared distance between (0,0,0) and the point on the box which is furthest away from (0,0,0). More...
|
csBox3& | operator+= (const csBox3 &box) |
| Compute the union of two bounding boxes.
|
csBox3& | operator+= (const csVector3 &point) |
| Compute the union of a point with this bounding box.
|
csBox3& | operator *= (const csBox3 &box) |
| Compute the intersection of two bounding boxes.
|
Static Public Methods |
int | OtherSide (int side) |
| Static function to get the 'other' side (i.e. More...
|
Protected Types |
typedef uint8 | bFace [4] |
Protected Attributes |
csVector3 | minbox |
| The top-left of this bounding box.
|
csVector3 | maxbox |
| The bottom-right.
|
Static Protected Attributes |
bEdge | edges [24] |
bFace | faces [6] |
Friends |
csBox3 | operator+ (const csBox3 &box1, const csBox3 &box2) |
| Compute the union of two bounding boxes.
|
csBox3 | operator+ (const csBox3 &box, const csVector3 &point) |
| Compute the union of a bounding box and a point.
|
csBox3 | operator * (const csBox3 &box1, const csBox3 &box2) |
| Compute the intersection of two bounding boxes.
|
bool | operator== (const csBox3 &box1, const csBox3 &box2) |
| Tests if two bounding boxes are equal.
|
bool | operator!= (const csBox3 &box1, const csBox3 &box2) |
| Tests if two bounding boxes are unequal.
|
bool | operator< (const csBox3 &box1, const csBox3 &box2) |
| Tests if box1 is a subset of box2.
|
bool | operator> (const csBox3 &box1, const csBox3 &box2) |
| Tests if box1 is a superset of box2.
|
bool | operator< (const csVector3 &point, const csBox3 &box) |
| Tests if a point is contained in a box.
|
In order to operate correctly, this bounding box assumes that all values entered or compared against lie within the range (-CS_BOUNDINGBOX_MAXVALUE, CS_BOUNDINGBOX_MAXVALUE). It is not recommended to use points outside of this range.