Public Member Functions | |
| BoundingBox () | |
| Creates an uninitialized bounding box. | |
| BoundingBox (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax) | |
| Creates a bounding box initialized to the given extents. | |
| BoundingBox (const Vec3 &min, const Vec3 &max) | |
| Creates a bounding box initialized to the given extents. | |
| void | init () |
| Clear the bounding box. | |
| bool | valid () const |
| Returns true if the bounding box extents are valid, false otherwise. | |
| void | set (float xmin, float ymin, float zmin, float xmax, float ymax, float zmax) |
| Sets the bounding box extents. | |
| void | set (const Vec3 &min, const Vec3 &max) |
| Sets the bounding box extents. | |
| float & | xMin () |
| float | xMin () const |
| float & | yMin () |
| float | yMin () const |
| float & | zMin () |
| float | zMin () const |
| float & | xMax () |
| float | xMax () const |
| float & | yMax () |
| float | yMax () const |
| float & | zMax () |
| float | zMax () const |
| const Vec3 | center () const |
| Calculates and returns the bounding box center. | |
| float | radius () const |
| Calculates and returns the bounding box radius. | |
| float | radius2 () const |
| Calculates and returns the squared length of the bounding box radius. | |
| const Vec3 | corner (unsigned int pos) const |
| Returns a specific corner of the bounding box. | |
| void | expandBy (const Vec3 &v) |
| Expands the bounding box to include the given coordinate. | |
| void | expandBy (float x, float y, float z) |
| Expands the bounding box to include the given coordinate. | |
| void | expandBy (const BoundingBox &bb) |
| Expands this bounding box to include the given bounding box. | |
| void | expandBy (const BoundingSphere &sh) |
| Expands this bounding box to include the given sphere. | |
| BoundingBox | intersect (const BoundingBox &bb) const |
| Returns the intesection of this bounding box and the specified bounding box. | |
| bool | intersects (const BoundingBox &bb) const |
| Return true if this bounding box intersects the specified bounding box. | |
| bool | contains (const Vec3 &v) const |
| Returns true if this bounding box contains the specified coordinate. | |
Public Attributes | |
| Vec3 | _min |
| Minimum extent. | |
| Vec3 | _max |
| Maximum extent. | |
Bounds leaf objects in a scene such as osg::Drawable objects. Used for frustum culling etc.
|
|
Creates an uninitialized bounding box.
|
|
||||||||||||||||||||||||||||
|
Creates a bounding box initialized to the given extents.
|
|
||||||||||||
|
Creates a bounding box initialized to the given extents.
|
|
|
Calculates and returns the bounding box center.
|
|
|
Returns true if this bounding box contains the specified coordinate.
|
|
|
Returns a specific corner of the bounding box. pos specifies the corner as a number between 0 and 7. Each bit selects an axis, X, Y, or Z from least- to most-significant. Unset bits select the minimum value for that axis, and set bits select the maximum. |
|
|
Expands this bounding box to include the given sphere. If this box is uninitialized, set it to include sh. |
|
|
Expands this bounding box to include the given bounding box. If this box is uninitialized, set it equal to bb. |
|
||||||||||||||||
|
Expands the bounding box to include the given coordinate. If the box is uninitialized, set its min and max extents to Vec3(x,y,z). |
|
|
Expands the bounding box to include the given coordinate. If the box is uninitialized, set its min and max extents to v. |
|
|
Clear the bounding box. Erases existing minimum and maximum extents. |
|
|
Returns the intesection of this bounding box and the specified bounding box.
|
|
|
Return true if this bounding box intersects the specified bounding box.
|
|
|
Calculates and returns the bounding box radius.
|
|
|
Calculates and returns the squared length of the bounding box radius. |
|
||||||||||||
|
Sets the bounding box extents.
|
|
||||||||||||||||||||||||||||
|
Sets the bounding box extents.
|
|
|
Returns true if the bounding box extents are valid, false otherwise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Maximum extent. (Greatest X, Y, and Z values of all coordinates.) |
|
|
Minimum extent. (Smallest X, Y, and Z values of all coordinates.) |