From 1a10795198f4377d761639e3a7f8b9ab88a50082 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 08:16:29 +0100 Subject: [PATCH] Added handling of possible zero divisor --- src/osgPlugins/bsp/VBSPGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/bsp/VBSPGeometry.cpp b/src/osgPlugins/bsp/VBSPGeometry.cpp index 08e7e8b88..52fa073e3 100644 --- a/src/osgPlugins/bsp/VBSPGeometry.cpp +++ b/src/osgPlugins/bsp/VBSPGeometry.cpp @@ -236,7 +236,7 @@ osg::Vec3 VBSPGeometry::getNormalFromEdges(int row, int col, // Scale the final normal according to how many triangle normals are // contributing - finalNormal *= (1.0f / (float)normalCount); + if (normalCount>0) finalNormal *= (1.0f / (float)normalCount); return finalNormal; }