Fix handling of in-scenegraph Drawables in DrawElementTypeSimplifier

This commit is contained in:
scrawl
2017-02-03 17:43:42 +01:00
parent 853418db94
commit c901694290
2 changed files with 3 additions and 11 deletions

View File

@@ -66,18 +66,10 @@ void DrawElementTypeSimplifier::simplify(osg::Geometry & geometry) const
}
}
void DrawElementTypeSimplifierVisitor::apply(osg::Geode& node)
void DrawElementTypeSimplifierVisitor::apply(osg::Geometry& geom)
{
DrawElementTypeSimplifier dets;
unsigned int numDrawables = node.getNumDrawables();
for (unsigned int i = 0; i != numDrawables; ++i)
{
osg::Geometry * geom = dynamic_cast<osg::Geometry*>(node.getDrawable(i));
if (geom) dets.simplify(*geom);
}
osg::NodeVisitor::apply((osg::Node&)node);
dets.simplify(geom);
}
}