Added computation of the bounding volume of osg::OccluderNodes.

Added support for osg::BoundingSphere::expandBy*(osg::BoundingBox) and have
added osg::BoundingSphere/Box::valid() which deprecates isValid(), this
is to be more consistent with other classes in the OSG.
This commit is contained in:
Robert Osfield
2002-06-19 15:18:47 +00:00
parent 21beb236d2
commit b12e36cede
4 changed files with 84 additions and 26 deletions

View File

@@ -111,25 +111,9 @@ const bool Geode::computeBound() const
bb.expandBy((*itr)->getBound());
}
if (bb.isValid())
if (bb.valid())
{
_bsphere._center = bb.center();
_bsphere._radius = 0.0f;
for(itr=_drawables.begin();
itr!=_drawables.end();
++itr)
{
const BoundingBox& bbox = (*itr)->getBound();
for(unsigned int c=0;c<8;++c)
{
_bsphere.expandRadiusBy(bbox.corner(c));
}
}
// if (_occluder.valid()) _occluder->computeBound(_bsphere);
_bsphere.expandBy(bb);
_bsphere_computed=true;
return true;
}