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

@ -718,7 +718,7 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2
RS::get_singleton()->instance_set_base(mesh_instance, mesh->get_rid());
AABB aabb = mesh->get_aabb();
Vector3 ofs = aabb.position + aabb.size * 0.5;
Vector3 ofs = aabb.get_center();
aabb.position -= ofs;
Transform3D xform;
xform.basis = Basis().rotated(Vector3(0, 1, 0), -Math_PI * 0.125);