Home | Download | Screen shots | Discussion | Documentation |
---|
Inheritance diagram for openvrml::bounding_volume:
Public Types | |
enum | intersection { inside = 1, outside = -1, partial = 0 } |
Public Member Functions | |
virtual | ~bounding_volume ()=0 |
Destructor. | |
virtual void | maximize ()=0 |
Maximize the bounding volume. | |
virtual bool | maximized () const=0 |
Indicates whether the bounding volume is maximized. | |
virtual intersection | intersect_frustum (const openvrml::frustum &frustum) const=0 |
Intersect this bvolume with a frustum. | |
virtual void | extend (const bounding_volume &bv)=0 |
Extend the bounding_volume to enclose bv . | |
virtual void | extend (const vec3f &p)=0 |
Extend the bounding volume to enclose p . | |
virtual void | extend (const axis_aligned_bounding_box &bbox)=0 |
Extend the bounding volume to enclose bbox . | |
virtual void | extend (const bounding_sphere &bs)=0 |
Extend this bvolume to enclose the given sphere. | |
virtual void | enclose (const std::vector< vec3f > &points)=0 |
Enclose the given set of points. | |
virtual void | ortho_transform (const mat4f &M)=0 |
Transform this bounding volume using an orthogonal transfom. | |
virtual void | transform (const mat4f &M)=0 |
Transform this bounding volume using an affine transfom. |
All the geometry in a scene maintains a bounding volume to help speed up rendering and picking. Although currently we're just using spheres, the plan is to eventually use tighter bounds like axis aligned boxes around nodes that are expected to be static. That probably means boxes for geometry and spheres for grouping nodes.
|
|
Enclose the given set of points. This resets the volume from any previous values.
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
Extend this bvolume to enclose the given sphere.
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
Extend the bounding volume to enclose
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
Extend the bounding volume to enclose
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
Extend the bounding_volume to enclose
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
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 bvolume's space, or transforming both of them into the projection space. Lots of tradeoffs involved, but transforming the bvolume is probably the simplest approach overall.)
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
Maximize the bounding volume.
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
Indicates whether the bounding volume is maximized. The convention is that nodes that should be rendered unconditionally set a maximum bounding volume, ensuring that the branch they are on does not get pruned during culling. Stuff like the picking code needs a way to differentiate this from just a really big bounding volume, or an unset bounding volume.
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
Transform this bounding volume using an orthogonal transfom. Orthogonal transformations preserve angles. They include translation, rotation, and uniform scaling. It turns out to be so easy to transform bounding spheres by orthogonal transformations that it's worth special casing. The caller is responsible for assuring that the transformation is in fact orthogonal, otherwise the results are undefined. If in doubt, call transform instead and take the speed hit.
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |
|
Transform this bounding volume using an affine transfom.
Affine transformations can include nonuniform scaling. It is much messier to deal with them, but VRML allows nonuniform scaling, so we have to handle it. Note that since all orthogonal transforms are affine, it's safe to always call this routine instead of
Implemented in openvrml::bounding_sphere, and openvrml::axis_aligned_bounding_box. |