General purpose axis-aligned bounding box class for enclosing objects/vertices.
Public Fields
-
Vec3 _min
- The corner with the smallest values for each coordinate of the bounding box
-
Vec3 _max
- The corner with the largest values for each coordinate of the bounding box
Public Methods
-
BoundingBox()
- construct to invalid values to represent an unset bounding box
-
inline void init()
- initialize to invalid values to represent an unset bounding box
-
inline const bool isValid() const
- return true if the bounding box contains valid values, false if the bounding box is effectively unset/empty
-
inline float& xMin()
-
inline const float xMin() const
-
inline float& yMin()
-
inline const float yMin() const
-
inline float& zMin()
-
inline const float zMin() const
-
inline float& xMax()
-
inline const float xMax() const
-
inline float& yMax()
-
inline const float yMax() const
-
inline float& zMax()
-
inline const float zMax() const
-
inline const Vec3 center() const
- Calculate and return the center of the bounding box
-
inline const float radius() const
- Calculate and return the radius of the bounding box
-
inline const float radius2() const
- Calculate and return the radius squared of the bounding box.
-
inline const Vec3 corner(unsigned int pos) const
- return the corner of the bounding box.
-
void expandBy(const Vec3& v)
- If the vertex is outwith the box expand to ecompass vertex.
-
void expandBy(const BoundingBox& bb)
- If incomming box is outwith the box expand to ecompass incomming box.
-
void expandBy(const BoundingSphere& sh)
- If incomming sphere is outwith the box expand to ecompass incomming sphere.
-
inline const bool contains(const Vec3& v) const
- 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.
- Vec3 _min
- The corner with the smallest values for each coordinate of the
bounding box
- Vec3 _max
- The corner with the largest values for each coordinate of the
bounding box
- BoundingBox()
- construct to invalid values to represent an unset bounding box
- inline void init()
- initialize to invalid values to represent an unset bounding box
- inline const bool isValid() const
- return true if the bounding box contains valid values,
false if the bounding box is effectively unset/empty
- inline float& xMin()
- inline const float xMin() const
- inline float& yMin()
- inline const float yMin() const
- inline float& zMin()
- inline const float zMin() const
- inline float& xMax()
- inline const float xMax() const
- inline float& yMax()
- inline const float yMax() const
- inline float& zMax()
- inline const float zMax() const
- inline const Vec3 center() const
- Calculate and return the center of the bounding box
- inline const float radius() const
- Calculate and return the radius of the bounding box
- inline const float radius2() const
- Calculate and return the radius squared of the bounding box.
Note, radius2() is faster to calculate than radius().
- inline const Vec3 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.
- void 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.
- void 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.
- void 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.
- inline const bool contains(const Vec3& v) const
- 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++.