#include <ddgbbox.h>
Class diagram for ddgBBox3:
Public Members | |||
enum | Split { XLT, XGT, YLT, YGT, ZLT, ZGT } | ||
Split options. | |||
ddgBBox3 (float xc = 0.0, float xd = MAXFLOAT, float yc = 0.0, float yd = MAXFLOAT, float zc = 0.0, float zd = MAXFLOAT) | |||
Default bounding box contains the entire 3D space. More... | |||
ddgBBox3 (const ddgVector3 &min, const ddgVector3 &max) | |||
Set bounding box using Min and Max vectors. | |||
void | set (float xmin = -MAXFLOAT, float xmax = MAXFLOAT, float ymin = -MAXFLOAT, float ymax = MAXFLOAT, float zmin = -MAXFLOAT, float zmax = MAXFLOAT) | ||
Set bounding box using Min Max coordinates. | |||
void | set (const ddgVector3 &pmin, const ddgVector3 &pmax) | ||
Set bounding box using another bounding box. | |||
float | minx ( void ) | ||
Return bounding box minimum x value. | |||
float | miny ( void ) | ||
Return bounding box minimum y value. | |||
float | minz ( void ) | ||
Return bounding box minimum z value. | |||
float | maxx ( void ) | ||
Return bounding box maximum x value. | |||
float | maxy ( void ) | ||
Return bounding box maximum y value. | |||
float | maxz ( void ) | ||
Return bounding box maximum z value. | |||
void | setx (float pmin, float pmax) | ||
Set the min and max of the bounding box along X-axis. | |||
void | sety (float pmin, float pmax) | ||
Set the min and max of the bounding box along Y-axis. | |||
void | setz (float pmin, float pmax) | ||
Set the min and max of the bounding box along Z-axis. | |||
void | split (Split side, float value = 0 ) | ||
Split a bounding box in a given direction. More... | |||
float | cornerx (int n) | ||
Return the X coordinate of a corner of the BBox. | |||
float | cornery (int n) | ||
Return the Y coordinate of a corner of the BBox. | |||
float | cornerz (int n) | ||
Return the Z coordinate of a corner of the BBox. | |||
void | copy (ddgBBox3 *src) | ||
Copy the content of the src bbox. | |||
ddgVector3 | centre (void) | ||
Return the centre point of the bounding box. | |||
void | move (ddgVector3 o) | ||
Move the bounding box by the specified vector. | |||
void | scale (ddgVector3 s) | ||
Scale the bounding box by the specified vector about its centre. | |||
float | distancesq ( ddgVector3 *p) | ||
Return the distance between the centre of the box and the coordinate. | |||
float | distance ( ddgVector3 *p) | ||
Return the true distance of the box's centre point to the eye. | |||
bool | intersect ( ddgVector3 *p1, ddgVector3 *p2) | ||
Test for intersection of line with bbox. | |||
bool | intersect ( ddgBBox3 *b ) | ||
Test for intersection of another bbox. | |||
ddgVector3 | size (void) | ||
Return the size of the box. | |||
ddgClipFlags | visibleSpace ( ddgBBox3 b, float tanHalfFOV ) | ||
Test a bounding box against this bounding box in camera space. More... | |||
ddgVector3 | min | ||
left bottom near corner of the bbox. | |||
ddgVector3 | max | ||
right top far corner of the bbox. | |||
Static Public Members | |||
short | _corner [8][3] | ||
Indexes to the corner points of the bounding box. |
This object defines a 3d volume based a min and max point in 3D space.
ddgBBox3::ddgBBox3 (float xc = 0.0, float xd = MAXFLOAT, float yc = 0.0, float yd = MAXFLOAT, float zc = 0.0, float zd = MAXFLOAT) |
Default bounding box contains the entire 3D space.
Set bounding box using centre point and delta.
void ddgBBox3::split (Split side, float value = 0) |
Split a bounding box in a given direction.
Optionally give a split location, default is in the middle of the box.
ddgClipFlags ddgBBox3::visibleSpace (ddgBBox3 b, float tanHalfFOV) |
Test a bounding box against this bounding box in camera space.
Returns true if camera coordinates are visible from camera, also indicates which half space the point was in. Assumes bbox is already in camera space. vis indicates which half spaces don't need to be tested.