Fixed then normal smoothing function in the .3ds loader and the

osgUtil::SmoothingVisitor so that unused normals at left at 0,0,0 insead
of being normalized, which results in (nan,nan,nan).
This commit is contained in:
Robert Osfield
2001-10-16 15:03:10 +00:00
parent 0bce843960
commit 8aefce4524
2 changed files with 5 additions and 2 deletions

View File

@@ -119,7 +119,8 @@ void SmoothingVisitor::smooth(osg::GeoSet& gset)
for(j = 0; j < ncoords; j++ )
{
norms[j].normalize();
float len = norms[j].length();
if (len) norms[j]/=len;
}
gset.setNormalBinding(osg::GeoSet::BIND_PERVERTEX);