Expose Mesh get_aabb

This commit is contained in:
Aaron Franke 2019-12-07 21:23:05 -05:00
parent cd9d513285
commit a139104646
No known key found for this signature in database
GPG Key ID: 40A1750B977E56BF
2 changed files with 9 additions and 0 deletions

View File

@ -40,6 +40,14 @@
Generate a [TriangleMesh] from the mesh. Generate a [TriangleMesh] from the mesh.
</description> </description>
</method> </method>
<method name="get_aabb" qualifiers="const">
<return type="AABB">
</return>
<description>
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].
</description>
</method>
<method name="get_faces" qualifiers="const"> <method name="get_faces" qualifiers="const">
<return type="PoolVector3Array"> <return type="PoolVector3Array">
</return> </return>

View File

@ -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("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_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"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "lightmap_size_hint"), "set_lightmap_size_hint", "get_lightmap_size_hint");