diff --git a/src/osgUtil/Simplifier.cpp b/src/osgUtil/Simplifier.cpp index 8e883ef99..cb3f2ad61 100644 --- a/src/osgUtil/Simplifier.cpp +++ b/src/osgUtil/Simplifier.cpp @@ -86,9 +86,6 @@ public: Point* computeInterpolatedPoint(Edge* edge,float r) const { - Point* point = new Point; - float r1 = 1.0f-r; - float r2 = r; Point* p1 = edge->_p1.get(); Point* p2 = edge->_p2.get(); @@ -98,6 +95,10 @@ public: return 0; } + Point* point = new Point; + float r1 = 1.0f-r; + float r2 = r; + point->_vertex = p1->_vertex * r1 + p2->_vertex * r2; unsigned int s = osg::minimum(p1->_attributes.size(),p2->_attributes.size()); for(unsigned int i=0;i