Added computeDataVariance method into osg::Object and implementations in Drawable and StateSet,

and calling of osgUtil::StaticObjectDetectionVisitor in osgViewer::Viewer
This commit is contained in:
Robert Osfield
2007-02-14 11:24:42 +00:00
parent 5dcb7af6a4
commit 89c99a88fa
256 changed files with 503 additions and 393 deletions

View File

@@ -4148,19 +4148,14 @@ void Optimizer::StaticObjectDetectionVisitor::apply(osg::Geode& geode)
void Optimizer::StaticObjectDetectionVisitor::applyStateSet(osg::StateSet& stateset)
{
stateset.setDataVariance(osg::Object::STATIC);
stateset.computeDataVariance();
}
void Optimizer::StaticObjectDetectionVisitor::applyDrawable(osg::Drawable& drawable)
{
{
if (drawable.getStateSet()) applyStateSet(*drawable.getStateSet());
osg::Object::DataVariance dataVariance = osg::Object::STATIC;
if (drawable.getDrawCallback()) dataVariance = osg::Object::DYNAMIC;
if (drawable.getCullCallback()) dataVariance = osg::Object::DYNAMIC;
if (drawable.getDrawCallback()) dataVariance = osg::Object::DYNAMIC;
drawable.setDataVariance(dataVariance);
drawable.computeDataVariance();
}