From a139104646d8358b881c33f5c79db4e414a1ab82 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Sat, 7 Dec 2019 21:23:05 -0500 Subject: [PATCH] Expose Mesh get_aabb --- doc/classes/Mesh.xml | 8 ++++++++ scene/resources/mesh.cpp | 1 + 2 files changed, 9 insertions(+) diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index f7b3b0d7eae..d4804930e1f 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -40,6 +40,14 @@ Generate a [TriangleMesh] from the mesh. + + + + + Returns the smallest [AABB] enclosing this mesh. Not affected by [code]custom_aabb[/code]. + [b]Note:[/b] This is only implemented for [ArrayMesh] and [PrimitiveMesh]. + + diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 4afb07cb6f2..0d94d4dbf43 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -483,6 +483,7 @@ void Mesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_lightmap_size_hint", "size"), &Mesh::set_lightmap_size_hint); ClassDB::bind_method(D_METHOD("get_lightmap_size_hint"), &Mesh::get_lightmap_size_hint); + ClassDB::bind_method(D_METHOD("get_aabb"), &Mesh::get_aabb); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "lightmap_size_hint"), "set_lightmap_size_hint", "get_lightmap_size_hint");