OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
osg::BoundingBoxImpl< VT > Singleton Reference

#include <BoundingBox.h>

Public Types

typedef VT vec_type
 
typedef VT::value_type value_type
 

Public Member Functions

 BoundingBoxImpl ()
 
template<typename BT >
 BoundingBoxImpl (const BoundingBoxImpl< BT > &bb)
 
 BoundingBoxImpl (value_type xmin, value_type ymin, value_type zmin, value_type xmax, value_type ymax, value_type zmax)
 
 BoundingBoxImpl (const vec_type &min, const vec_type &max)
 
void init ()
 
bool operator== (const BoundingBoxImpl &rhs) const
 
bool operator!= (const BoundingBoxImpl &rhs) const
 
bool valid () const
 
void set (value_type xmin, value_type ymin, value_type zmin, value_type xmax, value_type ymax, value_type zmax)
 
void set (const vec_type &min, const vec_type &max)
 
value_typexMin ()
 
value_type xMin () const
 
value_typeyMin ()
 
value_type yMin () const
 
value_typezMin ()
 
value_type zMin () const
 
value_typexMax ()
 
value_type xMax () const
 
value_typeyMax ()
 
value_type yMax () const
 
value_typezMax ()
 
value_type zMax () const
 
const vec_type center () const
 
value_type radius () const
 
value_type radius2 () const
 
const vec_type corner (unsigned int pos) const
 
void expandBy (const vec_type &v)
 
void expandBy (value_type x, value_type y, value_type z)
 
void expandBy (const BoundingBoxImpl &bb)
 
template<typename BST >
void expandBy (const BoundingSphereImpl< BST > &sh)
 
BoundingBoxImpl intersect (const BoundingBoxImpl &bb) const
 
bool intersects (const BoundingBoxImpl &bb) const
 
bool contains (const vec_type &v) const
 
bool contains (const vec_type &v, value_type epsilon) const
 

Public Attributes

vec_type _min
 
vec_type _max
 

Detailed Description

template<typename VT>
singleton osg::BoundingBoxImpl< VT >

General purpose axis-aligned bounding box class for enclosing objects/vertices. Bounds leaf objects in a scene such as osg::Drawable objects. Used for frustum culling etc.

Definition at line 33 of file BoundingBox.h.

Member Typedef Documentation

template<typename VT>
typedef VT::value_type osg::BoundingBoxImpl< VT >::value_type

Definition at line 37 of file BoundingBox.h.

template<typename VT>
typedef VT osg::BoundingBoxImpl< VT >::vec_type

Definition at line 36 of file BoundingBox.h.

Constructor & Destructor Documentation

template<typename VT>
osg::BoundingBoxImpl< VT >::BoundingBoxImpl ( )
inline

Creates an uninitialized bounding box.

Definition at line 45 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
template<typename BT >
osg::BoundingBoxImpl< VT >::BoundingBoxImpl ( const BoundingBoxImpl< BT > &  bb)
inline

Definition at line 55 of file BoundingBox.h.

template<typename VT>
osg::BoundingBoxImpl< VT >::BoundingBoxImpl ( value_type  xmin,
value_type  ymin,
value_type  zmin,
value_type  xmax,
value_type  ymax,
value_type  zmax 
)
inline

Creates a bounding box initialized to the given extents.

Definition at line 61 of file BoundingBox.h.

template<typename VT>
osg::BoundingBoxImpl< VT >::BoundingBoxImpl ( const vec_type min,
const vec_type max 
)
inline

Creates a bounding box initialized to the given extents.

Definition at line 67 of file BoundingBox.h.

Member Function Documentation

template<typename VT>
const vec_type osg::BoundingBoxImpl< VT >::center ( ) const
inline

Calculates and returns the bounding box center.

Definition at line 126 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
bool osg::BoundingBoxImpl< VT >::contains ( const vec_type v) const
inline

Returns true if this bounding box contains the specified coordinate.

Definition at line 233 of file BoundingBox.h.

Here is the call graph for this function:

template<typename VT>
bool osg::BoundingBoxImpl< VT >::contains ( const vec_type v,
value_type  epsilon 
) const
inline

Returns true if this bounding box contains the specified coordinate allowing for specific epsilon.

Definition at line 242 of file BoundingBox.h.

Here is the call graph for this function:

template<typename VT>
const vec_type osg::BoundingBoxImpl< VT >::corner ( unsigned int  pos) const
inline

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.

Definition at line 149 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
void osg::BoundingBoxImpl< VT >::expandBy ( const vec_type v)
inline

Expands the bounding box to include the given coordinate. If the box is uninitialized, set its min and max extents to v.

Definition at line 156 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
void osg::BoundingBoxImpl< VT >::expandBy ( value_type  x,
value_type  y,
value_type  z 
)
inline

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).

Definition at line 171 of file BoundingBox.h.

template<typename VT>
void osg::BoundingBoxImpl< VT >::expandBy ( const BoundingBoxImpl< VT > &  bb)
inline

Expands this bounding box to include the given bounding box. If this box is uninitialized, set it equal to bb.

Definition at line 185 of file BoundingBox.h.

Here is the call graph for this function:

template<typename VT>
template<typename BST >
void osg::BoundingBoxImpl< VT >::expandBy ( const BoundingSphereImpl< BST > &  sh)
inline

Expands this bounding box to include the given sphere. If this box is uninitialized, set it to include sh.

Definition at line 202 of file BoundingBox.h.

Here is the call graph for this function:

template<typename VT>
void osg::BoundingBoxImpl< VT >::init ( )
inline

Clear the bounding box. Erases existing minimum and maximum extents.

Definition at line 72 of file BoundingBox.h.

template<typename VT>
BoundingBoxImpl osg::BoundingBoxImpl< VT >::intersect ( const BoundingBoxImpl< VT > &  bb) const
inline

Returns the intersection of this bounding box and the specified bounding box.

Definition at line 218 of file BoundingBox.h.

Here is the call graph for this function:

template<typename VT>
bool osg::BoundingBoxImpl< VT >::intersects ( const BoundingBoxImpl< VT > &  bb) const
inline

Return true if this bounding box intersects the specified bounding box.

Definition at line 225 of file BoundingBox.h.

Here is the call graph for this function:

template<typename VT>
bool osg::BoundingBoxImpl< VT >::operator!= ( const BoundingBoxImpl< VT > &  rhs) const
inline

Definition at line 83 of file BoundingBox.h.

template<typename VT>
bool osg::BoundingBoxImpl< VT >::operator== ( const BoundingBoxImpl< VT > &  rhs) const
inline

Definition at line 82 of file BoundingBox.h.

template<typename VT>
value_type osg::BoundingBoxImpl< VT >::radius ( ) const
inline

Calculates and returns the bounding box radius.

Definition at line 132 of file BoundingBox.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename VT>
value_type osg::BoundingBoxImpl< VT >::radius2 ( ) const
inline

Calculates and returns the squared length of the bounding box radius. Note, radius2() is faster to calculate than radius().

Definition at line 139 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
void osg::BoundingBoxImpl< VT >::set ( value_type  xmin,
value_type  ymin,
value_type  zmin,
value_type  xmax,
value_type  ymax,
value_type  zmax 
)
inline

Sets the bounding box extents.

Definition at line 92 of file BoundingBox.h.

template<typename VT>
void osg::BoundingBoxImpl< VT >::set ( const vec_type min,
const vec_type max 
)
inline

Sets the bounding box extents.

Definition at line 100 of file BoundingBox.h.

template<typename VT>
bool osg::BoundingBoxImpl< VT >::valid ( ) const
inline

Returns true if the bounding box extents are valid, false otherwise.

Definition at line 86 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
value_type& osg::BoundingBoxImpl< VT >::xMax ( )
inline

Definition at line 116 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
value_type osg::BoundingBoxImpl< VT >::xMax ( ) const
inline

Definition at line 117 of file BoundingBox.h.

template<typename VT>
value_type& osg::BoundingBoxImpl< VT >::xMin ( )
inline

Definition at line 107 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
value_type osg::BoundingBoxImpl< VT >::xMin ( ) const
inline

Definition at line 108 of file BoundingBox.h.

template<typename VT>
value_type& osg::BoundingBoxImpl< VT >::yMax ( )
inline

Definition at line 119 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
value_type osg::BoundingBoxImpl< VT >::yMax ( ) const
inline

Definition at line 120 of file BoundingBox.h.

template<typename VT>
value_type& osg::BoundingBoxImpl< VT >::yMin ( )
inline

Definition at line 110 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
value_type osg::BoundingBoxImpl< VT >::yMin ( ) const
inline

Definition at line 111 of file BoundingBox.h.

template<typename VT>
value_type& osg::BoundingBoxImpl< VT >::zMax ( )
inline

Definition at line 122 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
value_type osg::BoundingBoxImpl< VT >::zMax ( ) const
inline

Definition at line 123 of file BoundingBox.h.

template<typename VT>
value_type& osg::BoundingBoxImpl< VT >::zMin ( )
inline

Definition at line 113 of file BoundingBox.h.

Here is the caller graph for this function:

template<typename VT>
value_type osg::BoundingBoxImpl< VT >::zMin ( ) const
inline

Definition at line 114 of file BoundingBox.h.

Member Data Documentation

template<typename VT>
vec_type osg::BoundingBoxImpl< VT >::_max

Maximum extent. (Greatest X, Y, and Z values of all coordinates.)

Definition at line 42 of file BoundingBox.h.

template<typename VT>
vec_type osg::BoundingBoxImpl< VT >::_min

Minimum extent. (Smallest X, Y, and Z values of all coordinates.)

Definition at line 40 of file BoundingBox.h.


The documentation for this singleton was generated from the following file: