Browse Source

Softbody triangle backface test fix (#1158)

When one triangle fails the backface test in RayCast, continue to check other triangles instead of exiting early.
Turánszki János 1 năm trước cách đây
mục cha
commit
77a0960c3c
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Jolt/Physics/SoftBody/SoftBodyShape.cpp

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

@@ -93,7 +93,7 @@ void SoftBodyShape::CastRay(const RayCast &inRay, const RayCastSettings &inRayCa
 
 		// Back facing check
 		if (inRayCastSettings.mBackFaceMode == EBackFaceMode::IgnoreBackFaces && (x2 - x1).Cross(x3 - x1).Dot(inRay.mDirection) > 0.0f)
-			return;
+			continue;
 
 		// Test ray against triangle
 		float fraction = RayTriangle(inRay.mOrigin, inRay.mDirection, x1, x2, x3);