mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
Add Get Center Method for Rect2/Rect2i and AABB.
This commit is contained in:
parent
87de2e7c4a
commit
90908cd67d
33 changed files with 133 additions and 56 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue