diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-23 21:55:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-23 21:55:16 +0200 |
commit | 4c3d5850de5f6870ff28fbfb9142e7093f76125d (patch) | |
tree | 53594829b1cb6ce168a99dbd96514f2f65eeab67 /core | |
parent | 28160e1a6f8886bb9416ea371f4dd77dc320377a (diff) | |
parent | cfb555a08175c811ea06a43ea320b81a2c90554a (diff) |
Merge pull request #50748 from JFonS/gizmo_rework
Node3D gizmo improvements
Diffstat (limited to 'core')
-rw-r--r-- | core/math/triangle_mesh.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp index 903d5951a8..bf06c848c5 100644 --- a/core/math/triangle_mesh.cpp +++ b/core/math/triangle_mesh.cpp @@ -32,9 +32,9 @@ #include "core/templates/sort_array.h" -int TriangleMesh::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, int p_depth, int &max_depth, int &max_alloc) { - if (p_depth > max_depth) { - max_depth = p_depth; +int TriangleMesh::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, int p_depth, int &r_max_depth, int &r_max_alloc) { + if (p_depth > r_max_depth) { + r_max_depth = p_depth; } if (p_size == 1) { @@ -70,10 +70,10 @@ int TriangleMesh::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, in } break; } - int left = _create_bvh(p_bvh, p_bb, p_from, p_size / 2, p_depth + 1, max_depth, max_alloc); - int right = _create_bvh(p_bvh, p_bb, p_from + p_size / 2, p_size - p_size / 2, p_depth + 1, max_depth, max_alloc); + int left = _create_bvh(p_bvh, p_bb, p_from, p_size / 2, p_depth + 1, r_max_depth, r_max_alloc); + int right = _create_bvh(p_bvh, p_bb, p_from + p_size / 2, p_size - p_size / 2, p_depth + 1, r_max_depth, r_max_alloc); - int index = max_alloc++; + int index = r_max_alloc++; BVH *_new = &p_bvh[index]; _new->aabb = aabb; _new->center = aabb.position + aabb.size * 0.5; |