diff --git a/include/osgUtil/Optimizer b/include/osgUtil/Optimizer index 665eafb91..520c0f748 100644 --- a/include/osgUtil/Optimizer +++ b/include/osgUtil/Optimizer @@ -403,7 +403,7 @@ class OSGUTIL_EXPORT Optimizer }; - /** Tessellate all geodes, to remove POLYGONS.*/ + /** Tessellate all Geometries, to remove POLYGONS.*/ class OSGUTIL_EXPORT TessellateVisitor : public BaseOptimizerVisitor { public: @@ -414,7 +414,7 @@ class OSGUTIL_EXPORT Optimizer TessellateVisitor(Optimizer* optimizer=0): BaseOptimizerVisitor(optimizer, TESSELLATE_GEOMETRY) {} - virtual void apply(osg::Geode& geode); + virtual void apply(osg::Geometry& geom); }; diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index ddacb8800..6e9e411b6 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -405,17 +405,10 @@ void Optimizer::optimize(osg::Node* node, unsigned int options) //////////////////////////////////////////////////////////////////////////// // Tessellate geometry - eg break complex POLYGONS into triangles, strips, fans.. //////////////////////////////////////////////////////////////////////////// -void Optimizer::TessellateVisitor::apply(osg::Geode& geode) +void Optimizer::TessellateVisitor::apply(osg::Geometry &geom) { - for(unsigned int i=0;i(geode.getDrawable(i)); - if (geom) { - osgUtil::Tessellator Tessellator; - Tessellator.retessellatePolygons(*geom); - } - } - traverse(geode); + osgUtil::Tessellator Tessellator; + Tessellator.retessellatePolygons(geom); }