diff --git a/include/osgUtil/DrawElementTypeSimplifier b/include/osgUtil/DrawElementTypeSimplifier index 0af5b5db4..d090eb3d7 100644 --- a/include/osgUtil/DrawElementTypeSimplifier +++ b/include/osgUtil/DrawElementTypeSimplifier @@ -34,7 +34,7 @@ class OSGUTIL_EXPORT DrawElementTypeSimplifierVisitor : public osg::NodeVisitor META_NodeVisitor(osgUtil, DrawElementTypeSimplifierVisitor); - void apply(osg::Geode& node); + void apply(osg::Geometry& geom); }; } diff --git a/src/osgUtil/DrawElementTypeSimplifier.cpp b/src/osgUtil/DrawElementTypeSimplifier.cpp index 0102bc2a5..6397f8e06 100644 --- a/src/osgUtil/DrawElementTypeSimplifier.cpp +++ b/src/osgUtil/DrawElementTypeSimplifier.cpp @@ -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(node.getDrawable(i)); - if (geom) dets.simplify(*geom); - } - - osg::NodeVisitor::apply((osg::Node&)node); + dets.simplify(geom); } }