class SG_EXPORT osg::BoundingBox

General purpose axis-aligned bounding box class for enclosing objects/vertices.

Public Fields

[more]Vec3 _min
The corner with the smallest values for each coordinate of the bounding box
[more]Vec3 _max
The corner with the largest values for each coordinate of the bounding box

Public Methods

[more] BoundingBox()
construct to invalid values to represent an unset bounding box
[more]void init()
initialize to invalid values to represent an unset bounding box
[more]bool isValid() const
return true if the bounding box contains valid values, false if the bounding box is effectively unset/empty
[more]float& xMin()
[more]float xMin() const
[more]float& yMin()
[more]float yMin() const
[more]float& zMin()
[more]float zMin() const
[more]float& xMax()
[more]float xMax() const
[more]float& yMax()
[more]float yMax() const
[more]float& zMax()
[more]float zMax() const
[more]Vec3 center() const
Calculate and return the center of the bounding box
[more]float radius() const
Calculate and return the radius of the bounding box
[more]float radius2() const
Calculate and return the radius squared of the bounding box.
[more]Vec3 corner(unsigned int pos) const
return the corner of the bounding box.
[more]void expandBy(const Vec3& v)
If the vertex is outwith the box expand to ecompass vertex.
[more]void expandBy(const BoundingBox& bb)
If incomming box is outwith the box expand to ecompass incomming box.
[more]void expandBy(const BoundingSphere& sh)
If incomming sphere is outwith the box expand to ecompass incomming sphere.
[more]bool contains(const Vec3& v)
return true is vertex v is within the box


Documentation

General purpose axis-aligned bounding box class for enclosing objects/vertices. Used to bounding the leaf objects in the scene, i.e. osg::GeoSet's to assist in view frustum culling etc.
oVec3 _min
The corner with the smallest values for each coordinate of the bounding box

oVec3 _max
The corner with the largest values for each coordinate of the bounding box

o BoundingBox()
construct to invalid values to represent an unset bounding box

ovoid init()
initialize to invalid values to represent an unset bounding box

obool isValid() const
return true if the bounding box contains valid values, false if the bounding box is effectively unset/empty

ofloat& xMin()

ofloat xMin() const

ofloat& yMin()

ofloat yMin() const

ofloat& zMin()

ofloat zMin() const

ofloat& xMax()

ofloat xMax() const

ofloat& yMax()

ofloat yMax() const

ofloat& zMax()

ofloat zMax() const

oVec3 center() const
Calculate and return the center of the bounding box

ofloat radius() const
Calculate and return the radius of the bounding box

ofloat radius2() const
Calculate and return the radius squared of the bounding box. Note, radius2() is faster to calculate than radius().

oVec3 corner(unsigned int pos) const
return the corner of the bounding box. Position (pos) is specfied by a number between 0 and 7, the first bit toggles between x min and x max, second bit toggles between y min and y max, third bit toggles between z min and z max.

ovoid expandBy(const Vec3& v)
If the vertex is outwith the box expand to ecompass vertex. If this box is empty then move set this box's min max to vertex.

ovoid expandBy(const BoundingBox& bb)
If incomming box is outwith the box expand to ecompass incomming box. If this box is empty then move set this box to incomming box.

ovoid expandBy(const BoundingSphere& sh)
If incomming sphere is outwith the box expand to ecompass incomming sphere. If this box is empty then move set this box to encompass the sphere.

obool contains(const Vec3& v)
return true is vertex v is within the box


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.