Added handling of possible zero divisor

This commit is contained in:
Robert Osfield 2016-06-30 08:16:29 +01:00
parent 77812b32e0
commit 1a10795198

View File

@ -236,7 +236,7 @@ osg::Vec3 VBSPGeometry::getNormalFromEdges(int row, int col,
// Scale the final normal according to how many triangle normals are // Scale the final normal according to how many triangle normals are
// contributing // contributing
finalNormal *= (1.0f / (float)normalCount); if (normalCount>0) finalNormal *= (1.0f / (float)normalCount);
return finalNormal; return finalNormal;
} }