StaticObjectDetectionVisitor: make use of apply(Drawable) visitor function

This commit is contained in:
scrawl
2017-01-20 21:48:45 +01:00
parent 764b2f60c6
commit ff1a9a195a
2 changed files with 4 additions and 19 deletions

View File

@@ -4405,14 +4405,11 @@ void Optimizer::StaticObjectDetectionVisitor::apply(osg::Node& node)
traverse(node);
}
void Optimizer::StaticObjectDetectionVisitor::apply(osg::Geode& geode)
void Optimizer::StaticObjectDetectionVisitor::apply(osg::Drawable& drawable)
{
if (geode.getStateSet()) applyStateSet(*geode.getStateSet());
if (drawable.getStateSet()) applyStateSet(*drawable.getStateSet());
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
{
applyDrawable(*geode.getDrawable(i));
}
drawable.computeDataVariance();
}
void Optimizer::StaticObjectDetectionVisitor::applyStateSet(osg::StateSet& stateset)
@@ -4421,15 +4418,6 @@ void Optimizer::StaticObjectDetectionVisitor::applyStateSet(osg::StateSet& state
}
void Optimizer::StaticObjectDetectionVisitor::applyDrawable(osg::Drawable& drawable)
{
if (drawable.getStateSet()) applyStateSet(*drawable.getStateSet());
drawable.computeDataVariance();
}
////////////////////////////////////////////////////////////////////////////
// FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor