From 4d5df6dc9a220ba4754ac1ee0ed04afd7f7402fd Mon Sep 17 00:00:00 2001 From: Vitaly Ovchinnikov Date: Thu, 11 Feb 2016 12:19:06 +1300 Subject: [PATCH] use NormalizeSafe to prevent NaN when normalizing zero vectors --- code/SmoothingGroups.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/SmoothingGroups.inl b/code/SmoothingGroups.inl index 4f072ad1a..42c500070 100644 --- a/code/SmoothingGroups.inl +++ b/code/SmoothingGroups.inl @@ -119,7 +119,7 @@ void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups& sMesh) { vNormals += sMesh.mNormals[(*a)]; } - vNormals.Normalize(); + vNormals.NormalizeSafe(); // write back into all affected normals for (std::vector::const_iterator