Update water material collision detection logic

This commit is contained in:
2026-04-07 10:37:54 +02:00
parent 05caaf888f
commit 12fe38c268

View File

@@ -824,7 +824,7 @@ export function collectWaterContactPatches(volume: OrientedWaterVolume, contactB
maxZ = Math.max(maxZ, localPoint.z);
}
if (maxX <= -halfX || minX >= halfX || maxZ <= -halfZ || minZ >= halfZ) {
if (maxX < -halfX || minX > halfX || maxZ < -halfZ || minZ > halfZ) {
continue;
}
@@ -840,7 +840,7 @@ export function collectWaterContactPatches(volume: OrientedWaterVolume, contactB
halfZ
);
if (calculatePolygonArea(clippedFootprint) <= WATER_CONTACT_EPSILON) {
if (clippedFootprint.length < 2) {
continue;
}