Google

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]inline BoundingBox()
construct to invalid values to represent an unset bounding box
[more]inline BoundingBox(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
construct to with specified min and max values
[more]inline BoundingBox(const Vec3& min, const Vec3& max)
construct to with specified min and max values
[more]inline void init()
initialize to invalid values to represent an unset bounding box
[more]inline bool valid() const
[more]inline void set(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
[more]inline void set(const Vec3& min, const Vec3& max)
construct to with specified min and max values
[more]inline float& xMin()
[more]inline float xMin() const
[more]inline float& yMin()
[more]inline float yMin() const
[more]inline float& zMin()
[more]inline float zMin() const
[more]inline float& xMax()
[more]inline float xMax() const
[more]inline float& yMax()
[more]inline float yMax() const
[more]inline float& zMax()
[more]inline float zMax() const
[more]inline const Vec3 center() const
Calculate and return the center of the bounding box
[more]inline float radius() const
Calculate and return the radius of the bounding box
[more]inline float radius2() const
Calculate and return the radius squared of the bounding box.
[more]inline const Vec3 corner(unsigned int pos) const
return the corner of the bounding box.
[more]inline void expandBy(const Vec3& v)
If the vertex is out-with the box expand to encompass vertex.
[more]inline void expandBy(float x, float y, float z)
If the vertex is out-with the box expand to encompass vertex.
[more]void expandBy(const BoundingBox& bb)
If incoming box is out-with the box expand to encompass incoming box.
[more]void expandBy(const BoundingSphere& sh)
If incoming sphere is out-with the box expand to encompass incoming sphere.
[more]inline 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::Drawable'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

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

oinline BoundingBox(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
construct to with specified min and max values

oinline BoundingBox(const Vec3& min, const Vec3& max)
construct to with specified min and max values

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

oinline bool valid() const

oinline void set(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)

oinline void set(const Vec3& min, const Vec3& max)
construct to with specified min and max values

oinline float& xMin()

oinline float xMin() const

oinline float& yMin()

oinline float yMin() const

oinline float& zMin()

oinline float zMin() const

oinline float& xMax()

oinline float xMax() const

oinline float& yMax()

oinline float yMax() const

oinline float& zMax()

oinline float zMax() const

oinline const Vec3 center() const
Calculate and return the center of the bounding box

oinline float radius() const
Calculate and return the radius of the bounding box

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

oinline const Vec3 corner(unsigned int pos) const
return the corner of the bounding box. Position (pos) is specified 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.

oinline void expandBy(const Vec3& v)
If the vertex is out-with the box expand to encompass vertex. If this box is empty then move set this box's min max to vertex.

oinline void expandBy(float x, float y, float z)
If the vertex is out-with the box expand to encompass vertex. If this box is empty then move set this box's min max to vertex.

ovoid expandBy(const BoundingBox& bb)
If incoming box is out-with the box expand to encompass incoming box. If this box is empty then move set this box to incoming box.

ovoid expandBy(const BoundingSphere& sh)
If incoming sphere is out-with the box expand to encompass incoming sphere. If this box is empty then move set this box to encompass the sphere.

oinline 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++.