14#ifndef OSG_BOUNDINGSPHERE
15#define OSG_BOUNDINGSPHERE 1
95 template<
typename vector_type>
101 template<
typename vector_type>
116 template<
typename BBT>
121 template<
typename BBT>
142template<
typename vector_type>
164template<
typename vector_type>
184 if (!sh.
valid())
return;
221 double ratio = ( new_radius -
_radius ) / d ;
251template<
typename BBT>
260 for(
unsigned int c=0;c<8;++c)
282template<
typename BBT>
289 for(
unsigned int c=0;c<8;++c)
305#ifdef OSG_USE_FLOAT_BOUNDINGSPHERE
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
BoundingSphered BoundingSphere
Definition BoundingSphere:308
BoundingSphereImpl< Vec3f > BoundingSpheref
Definition BoundingSphere:302
BoundingSphereImpl< Vec3d > BoundingSphered
Definition BoundingSphere:303
General purpose bounding sphere class for enclosing nodes/objects/vertices.
Definition BoundingSphere:35
bool operator!=(const BoundingSphereImpl &rhs) const
Definition BoundingSphere:67
void init()
Clear the bounding sphere.
Definition BoundingSphere:56
BoundingSphereImpl(const BoundingSphereImpl &bs)
Creates a bounding sphere initialized to the given extents.
Definition BoundingSphere:50
value_type radius2() const
Returns the squared length of the radius.
Definition BoundingSphere:90
vec_type & center()
Definition BoundingSphere:77
bool intersects(const BoundingSphereImpl &bs) const
Returns true if there is a non-empty intersection with the given bounding sphere.
Definition BoundingSphere:133
bool operator==(const BoundingSphereImpl &rhs) const
Definition BoundingSphere:66
bool contains(const vec_type &v) const
Returns true if v is within the sphere.
Definition BoundingSphere:125
void expandBy(const vector_type &v)
Expands the sphere to encompass the given point.
Definition BoundingSphere:143
void expandRadiusBy(const BoundingBoxImpl< BBT > &bb)
Expands the sphere to encompass the given box.
Definition BoundingSphere:283
const vec_type & center() const
Returns the const center of the bounding sphere.
Definition BoundingSphere:80
void expandRadiusBy(const vector_type &v)
Expands the sphere to encompass the given point.
Definition BoundingSphere:165
value_type _radius
Definition BoundingSphere:41
vec_type _center
Definition BoundingSphere:40
VT vec_type
Definition BoundingSphere:37
VT::value_type value_type
Definition BoundingSphere:38
BoundingSphereImpl(const BoundingBoxImpl< VT > &bb)
Creates a bounding sphere initialized to the given extents.
Definition BoundingSphere:53
void expandBy(const BoundingBoxImpl< BBT > &bb)
Expands the sphere to encompass the given box.
Definition BoundingSphere:252
void set(const vec_type ¢er, value_type radius)
Set the bounding sphere to the given center/radius using floats.
Definition BoundingSphere:70
void expandBy(const BoundingSphereImpl &sh)
Expands the sphere to encompass the given sphere.
Definition BoundingSphere:181
BoundingSphereImpl(const vec_type &cntr, value_type rad)
Creates a bounding sphere initialized to the given extents.
Definition BoundingSphere:47
BoundingSphereImpl()
Construct a default bounding sphere with radius to -1.0f, representing an invalid/unset bounding sphe...
Definition BoundingSphere:44
bool valid() const
Returns true of the bounding sphere extents are valid, false otherwise.
Definition BoundingSphere:64
value_type & radius()
Definition BoundingSphere:83
value_type radius() const
Returns the const radius of the bounding sphere.
Definition BoundingSphere:85
void expandRadiusBy(const BoundingSphereImpl &sh)
Expands the sphere to encompass the given sphere.
Definition BoundingSphere:232
General purpose axis-aligned bounding box class for enclosing objects/vertices.
Definition BoundingBox:34
const vec_type center() const
Calculates and returns the bounding box center.
Definition BoundingBox:126
void expandBy(const vec_type &v)
Expands the bounding box to include the given coordinate.
Definition BoundingBox:156
const vec_type corner(unsigned int pos) const
Returns a specific corner of the bounding box.
Definition BoundingBox:149
bool valid() const
Returns true if the bounding box extents are valid, false otherwise.
Definition BoundingBox:86
value_type radius() const
Calculates and returns the bounding box radius.
Definition BoundingBox:132