From 8db2413c8419d499ed9181a63d4dd2b0d14cae1e Mon Sep 17 00:00:00 2001 From: Alessio Quaglino Date: Mon, 28 Jul 2025 04:39:58 -0700 Subject: [PATCH] Fix a bug in triangle-box filter that caused missing Octree leaves. PiperOrigin-RevId: 787955811 Change-Id: I40ad0f9219cbe5d5757b9345b1de495cba50d306 --- src/user/user_objects.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user/user_objects.cc b/src/user/user_objects.cc index 1e7a22e8..2eed2465 100644 --- a/src/user/user_objects.cc +++ b/src/user/user_objects.cc @@ -640,7 +640,7 @@ static bool boxTriangle(const Triangle& v, const double aamm[6]) { int c = (a + 2) % 3; for (int i = 0; i < 3; i++) { double sign = n[a] >= 0 ? 1 : -1; - double ne[2] = {-e[i][c] * sign, -e[i][b] * sign}; + double ne[2] = {-e[i][c] * sign, e[i][b] * sign}; double vi[2] = {v[i][b], v[i][c]}; double d = -dot2(ne, vi) + mju_max(0, size[b]*ne[0]) + mju_max(0, size[c]*ne[1]); double p[2] = {aamm[b], aamm[c]};