From 6ad0f9badc1881da83b2b37e20316cdf8e47928e Mon Sep 17 00:00:00 2001 From: Laurens Voerman Date: Thu, 6 Oct 2016 14:21:07 +0200 Subject: [PATCH] fix bug in SmoothingVisitor tripped by bunny.ply --- src/osgUtil/SmoothingVisitor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osgUtil/SmoothingVisitor.cpp b/src/osgUtil/SmoothingVisitor.cpp index 14c466825..2112fda6c 100644 --- a/src/osgUtil/SmoothingVisitor.cpp +++ b/src/osgUtil/SmoothingVisitor.cpp @@ -659,14 +659,16 @@ static void smooth_new(osg::Geometry& geom, double creaseAngle) // fsef.listProblemVertices(); fsef.updateGeometry(); + vertices = dynamic_cast(geom.getVertexArray()); + normals = dynamic_cast(geom.getNormalArray()); osg::TriangleIndexFunctor stif2; if (stif2.set(vertices, normals)) { // accumulate all the normals - geom.accept(stif); + geom.accept(stif2); // normalize the normals - stif.normalize(); + stif2.normalize(); } }