소스 검색

[3.x] BVH - fix axis getting mixed up when split leaf

Split preferentially on longest axis, rather than shortest axis.
风青山 1 년 전
부모
커밋
ab76395144
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      core/math/bvh_split.inc

+ 2 - 2
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) {