Home | Download | Screen shots | Discussion | Documentation |
---|
Inheritance diagram for openvrml::bounding_sphere:
Public Member Functions | |
bounding_sphere () | |
Construct. | |
virtual | ~bounding_sphere () |
Destroy. | |
virtual intersection | intersect_frustum (const openvrml::frustum &frustum) const |
Intersect this bvolume with a frustum. | |
virtual void | extend (const bounding_volume &b) |
Extend the bounding_volume to enclose bv . | |
virtual void | extend (const vec3f &p) |
Extend to enclose p . | |
virtual void | extend (const axis_aligned_bounding_box &b) |
Extend the bounding volume to enclose bbox . | |
virtual void | extend (const bounding_sphere &b) |
Extend this bvolume to enclose the given sphere. | |
virtual void | enclose (const std::vector< vec3f > &points) |
Enclose the given set of points. | |
virtual void | maximize () |
Extend the bounding sphere to infinity. | |
virtual bool | maximized () const |
Whether the bounding_sphere is maximized. | |
virtual void | ortho_transform (const mat4f &t) |
Orthographically transform the bounding_sphere by t . | |
virtual void | transform (const mat4f &t) |
Transform the bounding_sphere by t . | |
void | center (const vec3f &c) |
Set the center coordinates. | |
const vec3f & | center () const |
Get the center coordinates. | |
void | radius (float r) |
Set the radius. | |
float | radius () const |
Get the radius. | |
Private Attributes | |
vec3f | center_ |
The center of the sphere. | |
float | radius_ |
The radius of the sphere. |
Bounding spheres are very fast to intersect test, but they are fairly loose. If asked to choose just one bounding volume, four out of five graphics professionals surveyed chose the bounding sphere for their patients who chewed bounding volumes.
|
Construct.
|
|
Destroy.
|
|
Get the center coordinates.
|
|
Set the center coordinates.
|
|
Enclose the given set of points. This resets the volume from any previous values.
Implements openvrml::bounding_volume. |
|
Extend this bvolume to enclose the given sphere.
Implements openvrml::bounding_volume. |
|
Extend the bounding volume to enclose
Implements openvrml::bounding_volume. |
|
Extend to enclose
Implements openvrml::bounding_volume. |
|
Extend the bounding_volume to enclose
Implements openvrml::bounding_volume. |
|
Intersect this bvolume with a frustum. The test assumes that the frustum is in the canonical looking-down-negative-z orientation, so the bounding volume is going to have to be transformed into the frustum's space. (Alternatives include transforming the frustum into the bounding volume's space, or transforming both of them into the projection space. Lots of tradeoffs involved, but transforming the bounding volume is probably the simplest approach overall.)
Implements openvrml::bounding_volume. |
|
Extend the bounding sphere to infinity.
Implements openvrml::bounding_volume. |
|
Whether the bounding_sphere is maximized.
Implements openvrml::bounding_volume. |
|
Orthographically transform the bounding_sphere by
Implements openvrml::bounding_volume. |
|
Get the radius.
|
|
Set the radius.
|
|
Transform the bounding_sphere by
Implements openvrml::bounding_volume. |
|
The center of the sphere.
|
|
The radius of the sphere.
|