diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-21 21:30:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-21 21:30:30 +0200 |
commit | ba57252bd8d7928c29e818b1ccf557e279c33ca0 (patch) | |
tree | 6b037a4a0b8b6907d571b1b847ed6ab3bc7507c3 /core/math/triangle_mesh.cpp | |
parent | 726b826b310900ff475122ed65934d2499b8db4d (diff) | |
parent | 90908cd67d3f44ba70cc4b7b32f024ce508cc0ee (diff) |
Merge pull request #52878 from AnilBK/add-get-center
Diffstat (limited to 'core/math/triangle_mesh.cpp')
-rw-r--r-- | core/math/triangle_mesh.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp index bf06c848c5..16d9652ef2 100644 --- a/core/math/triangle_mesh.cpp +++ b/core/math/triangle_mesh.cpp @@ -76,7 +76,7 @@ int TriangleMesh::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, in int index = r_max_alloc++; BVH *_new = &p_bvh[index]; _new->aabb = aabb; - _new->center = aabb.position + aabb.size * 0.5; + _new->center = aabb.get_center(); _new->face_index = -1; _new->left = left; _new->right = right; @@ -152,7 +152,7 @@ void TriangleMesh::create(const Vector<Vector3> &p_faces) { bw[i].left = -1; bw[i].right = -1; bw[i].face_index = i; - bw[i].center = bw[i].aabb.position + bw[i].aabb.size * 0.5; + bw[i].center = bw[i].aabb.get_center(); } vertices.resize(db.size()); |