浏览代码

use NormalizeSafe to prevent NaN when normalizing zero vectors

Vitaly Ovchinnikov 9 年之前
父节点
当前提交
4d5df6dc9a
共有 1 个文件被更改,包括 1 次插入1 次删除
  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