use NormalizeSafe to prevent NaN when normalizing zero vectors

pull/790/head
Vitaly Ovchinnikov 2016-02-11 12:19:06 +13:00
parent 8681abe845
commit 4d5df6dc9a
1 changed files with 1 additions and 1 deletions

View File

@ -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