summaryrefslogtreecommitdiff
path: root/modules/csg
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2021-09-21 00:33:52 +0545
committerAnilforextra <anilforextra@gmail.com>2021-09-21 21:14:17 +0545
commit90908cd67d3f44ba70cc4b7b32f024ce508cc0ee (patch)
tree4c3f64aa550e6dc763b9776dded65560b67db2cc /modules/csg
parent87de2e7c4a38b1258d9a554c7f50cdbd8ac825fa (diff)
Add Get Center Method for Rect2/Rect2i and AABB.
Diffstat (limited to 'modules/csg')
-rw-r--r--modules/csg/csg.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp
index cb82b65307..cbe41a1310 100644
--- a/modules/csg/csg.cpp
+++ b/modules/csg/csg.cpp
@@ -517,7 +517,7 @@ int CSGBrushOperation::MeshMerge::_create_bvh(FaceBVH *facebvhptr, FaceBVH **fac
int index = r_max_alloc++;
FaceBVH *_new = &facebvhptr[index];
_new->aabb = aabb;
- _new->center = aabb.position + aabb.size * 0.5;
+ _new->center = aabb.get_center();
_new->face = -1;
_new->left = left;
_new->right = right;
@@ -678,7 +678,7 @@ void CSGBrushOperation::MeshMerge::mark_inside_faces() {
facebvh[i].aabb.position = points[faces[i].points[0]];
facebvh[i].aabb.expand_to(points[faces[i].points[1]]);
facebvh[i].aabb.expand_to(points[faces[i].points[2]]);
- facebvh[i].center = facebvh[i].aabb.position + facebvh[i].aabb.size * 0.5;
+ facebvh[i].center = facebvh[i].aabb.get_center();
facebvh[i].aabb.grow_by(vertex_snap);
facebvh[i].next = -1;