Browse Source

Merge pull request #790 from ov/safe-normalizing-in-smoothing-groups

use NormalizeSafe to prevent NaN when normalizing zero vectors
Alexander Gessler 9 năm trước cách đây
mục cha
commit
88fee56cce
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      code/SmoothingGroups.inl

+ 1 - 1
code/SmoothingGroups.inl

@@ -119,7 +119,7 @@ void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups<T>& sMesh)
             {
                 vNormals += sMesh.mNormals[(*a)];
             }
-            vNormals.Normalize();
+            vNormals.NormalizeSafe();
 
             // write back into all affected normals
             for (std::vector<unsigned int>::const_iterator