Fix handling of in-scenegraph drawables in osgUtil::Simplifier

This commit is contained in:
scrawl 2017-02-03 17:33:58 +01:00
parent 2a7d72c203
commit a13b66135f

View File

@ -97,16 +97,9 @@ class OSGUTIL_EXPORT Simplifier : public osg::NodeVisitor
return getSampleRatio()<1.0; return getSampleRatio()<1.0;
} }
virtual void apply(osg::Geode& geode) virtual void apply(osg::Geometry& geom)
{ {
for(unsigned int i=0;i<geode.getNumDrawables();++i) simplify(geom);
{
osg::Geometry* geometry = geode.getDrawable(i)->asGeometry();
if (geometry)
{
simplify(*geometry);
}
}
} }
/** simply the geometry.*/ /** simply the geometry.*/