Fix for wrong intersection result
@@ -114,6 +114,7 @@
var currentIntersectInfo = ray.intersectsTriangle(p0, p1, p2);
if (currentIntersectInfo) {
+ if(currentIntersectInfo.distance < 0 ) continue;
if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) {
intersectInfo = currentIntersectInfo;
intersectInfo.faceId = index / 3;
@@ -125,6 +125,7 @@
@@ -180,4 +181,4 @@
return new BABYLON.SubMesh(materialIndex, minVertexIndex, maxVertexIndex - minVertexIndex + 1, startIndex, indexCount, mesh, renderingMesh);
}
-}
+}