Updates NEWS file for 0.9.0 release.
Added default computeBound() implementation to osg::Drawable which uses a PrimtiveFunctor to compute the bounding box in a generic way, that will work for all Drawable subclasses that implement the accept(PrimitiveFunctor&).
This commit is contained in:
@@ -222,25 +222,25 @@ void Geometry::accept(PrimitiveFunctor& functor)
|
||||
|
||||
}
|
||||
|
||||
|
||||
const bool Geometry::computeBound() const
|
||||
{
|
||||
_bbox.init();
|
||||
|
||||
const Vec3Array* coords = dynamic_cast<const Vec3Array*>(_vertexArray.get());
|
||||
if (coords)
|
||||
{
|
||||
for(Vec3Array::const_iterator itr=coords->begin();
|
||||
itr!=coords->end();
|
||||
++itr)
|
||||
{
|
||||
_bbox.expandBy(*itr);
|
||||
}
|
||||
}
|
||||
_bbox_computed = true;
|
||||
|
||||
return _bbox.valid();
|
||||
}
|
||||
// just use the base Drawable's PrimitiveFunctor based implementation.
|
||||
// const bool Geometry::computeBound() const
|
||||
// {
|
||||
// _bbox.init();
|
||||
//
|
||||
// const Vec3Array* coords = dynamic_cast<const Vec3Array*>(_vertexArray.get());
|
||||
// if (coords)
|
||||
// {
|
||||
// for(Vec3Array::const_iterator itr=coords->begin();
|
||||
// itr!=coords->end();
|
||||
// ++itr)
|
||||
// {
|
||||
// _bbox.expandBy(*itr);
|
||||
// }
|
||||
// }
|
||||
// _bbox_computed = true;
|
||||
//
|
||||
// return _bbox.valid();
|
||||
// }
|
||||
|
||||
bool Geometry::verifyBindings() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user