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

@ -80,7 +80,7 @@ void MeshEditor::edit(Ref<Mesh> p_mesh) {
_update_rotation();
AABB aabb = mesh->get_aabb();
Vector3 ofs = aabb.position + aabb.size * 0.5;
Vector3 ofs = aabb.get_center();
float m = aabb.get_longest_axis_size();
if (m != 0) {
m = 1.0 / m;