Public Member Functions | |
| BoundingSphere () | |
| Construct a default bounding sphere with radius to -1.0f, representing an invalid/unset bounding sphere. | |
| BoundingSphere (const Vec3 ¢er, float radius) | |
| Creates a bounding sphere initialized to the given extents. | |
| BoundingSphere (const BoundingSphere &bs) | |
| Creates a bounding sphere initialized to the given extents. | |
| BoundingSphere (const BoundingBox &bb) | |
| Creates a bounding sphere initialized to the given extents. | |
| void | init () |
| Clear the bounding sphere. | |
| bool | valid () const |
| Returns true of the bounding sphere extents are valid, false otherwise. | |
| void | set (const Vec3 ¢er, float radius) |
| Set the bounding sphere to the given center/radius. | |
| Vec3 & | center () |
| Returns the center of the bounding sphere. | |
| const Vec3 & | center () const |
| Returns the const center of the bounding sphere. | |
| float & | radius () |
| Returns the radius of the bounding sphere. | |
| float | radius () const |
| Returns the const radius of the bounding sphere. | |
| float | radius2 () const |
| Returns the squared length of the radius. | |
| void | expandBy (const Vec3 &v) |
| Expands the sphere to encompass the given point. | |
| void | expandRadiusBy (const Vec3 &v) |
| Expands the sphere to encompass the given point. | |
| void | expandBy (const BoundingSphere &sh) |
| Expands the sphere to encompass the given sphere. | |
| void | expandRadiusBy (const BoundingSphere &sh) |
| Expands the sphere to encompass the given sphere. | |
| void | expandBy (const BoundingBox &bb) |
| Expands the sphere to encompass the given box. | |
| void | expandRadiusBy (const BoundingBox &bb) |
| Expands the sphere to encompass the given box. | |
| bool | contains (const Vec3 &v) const |
| Returns true if v is within the sphere. | |
| bool | intersects (const BoundingSphere &bs) const |
| Returns true if there is a non-empty intersection with the given bounding sphere. | |
Public Attributes | |
| Vec3 | _center |
| float | _radius |
Bounds internal osg::Nodes in the scene, assists in view frustum culling, etc. Similar in function to BoundingBox, it's quicker for evaluating culling but generally will not cull as aggressively because it encloses a greater volume.
|
|
Construct a default bounding sphere with radius to -1.0f, representing an invalid/unset bounding sphere.
|
|
||||||||||||
|
Creates a bounding sphere initialized to the given extents.
|
|
|
Creates a bounding sphere initialized to the given extents.
|
|
|
Creates a bounding sphere initialized to the given extents.
|
|
|
Returns the const center of the bounding sphere.
|
|
|
Returns the center of the bounding sphere.
|
|
|
Returns true if v is within the sphere.
|
|
|
Expands the sphere to encompass the given box. Repositions the sphere center to minimize the radius increase. |
|
|
Expands the sphere to encompass the given sphere. Repositions the sphere center to minimize the radius increase. If the sphere is uninitialized, set its center and radius to match sh. |
|
|
Expands the sphere to encompass the given point. Repositions the sphere center to minimize the radius increase. If the sphere is uninitialized, set its center to v and radius to zero. |
|
|
Expands the sphere to encompass the given box. Does not repositions the sphere center. |
|
|
Expands the sphere to encompass the given sphere. Does not repositions the sphere center. If the sphere is uninitialized, set its center and radius to match sh. |
|
|
Expands the sphere to encompass the given point. Does not reposition the sphere center. If the sphere is uninitialized, set its center to v and radius to zero. |
|
|
Clear the bounding sphere. Reset to default values. |
|
|
Returns true if there is a non-empty intersection with the given bounding sphere.
|
|
|
Returns the const radius of the bounding sphere.
|
|
|
Returns the radius of the bounding sphere.
|
|
|
Returns the squared length of the radius. Note, For performance reasons, the calling method is responsible for checking to make sure the sphere is valid. |
|
||||||||||||
|
Set the bounding sphere to the given center/radius.
|
|
|
Returns true of the bounding sphere extents are valid, false otherwise.
|
|
|
|
|
|
|