Browse Source

Fixed unnormalized normal when one of the faces is degenerate

Jorrit Rouwe 1 year ago
parent
commit
17d727a8d0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Jolt/Physics/SoftBody/SoftBodyMotionProperties.cpp

+ 1 - 1
Jolt/Physics/SoftBody/SoftBodyMotionProperties.cpp

@@ -778,7 +778,7 @@ void SoftBodyMotionProperties::SkinVertices(RMat44Arg inRootTransform, const Mat
 				normal += (v1 - v0).Cross(v2 - v0).NormalizedOr(Vec3::sZero());
 				++f;
 			}
-			normal /= float(num_faces);
+			normal = normal.NormalizedOr(Vec3::sZero());
 		}
 		mSkinState[s.mVertex].mNormal = normal;
 	}