1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add Get Center Method for Rect2/Rect2i and AABB.

This commit is contained in:
Anilforextra
2021-09-21 00:33:52 +05:45
parent 87de2e7c4a
commit 90908cd67d
33 changed files with 133 additions and 56 deletions

View File

@@ -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());