From ab76395144baa431865ef2b39c6c9cfa11b8f154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E9=9D=92=E5=B1=B1?= Date: Fri, 29 Sep 2023 14:35:33 +0800 Subject: [PATCH] [3.x] BVH - fix axis getting mixed up when split leaf Split preferentially on longest axis, rather than shortest axis. --- core/math/bvh_split.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/math/bvh_split.inc b/core/math/bvh_split.inc index c77b525b14a..e2a4fdd72ec 100644 --- a/core/math/bvh_split.inc +++ b/core/math/bvh_split.inc @@ -30,8 +30,8 @@ void _split_leaf_sort_groups_simple(int &num_a, int &num_b, uint16_t *group_a, u int order[POINT::AXIS_COUNT]; - order[0] = size.min_axis(); - order[POINT::AXIS_COUNT - 1] = size.max_axis(); + order[0] = size.max_axis(); + order[POINT::AXIS_COUNT - 1] = size.min_axis(); static_assert(POINT::AXIS_COUNT <= 3, "BVH POINT::AXIS_COUNT has unexpected size"); if (POINT::AXIS_COUNT == 3) {