summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/Shape3D.xml7
-rw-r--r--scene/resources/shape_3d.cpp2
2 files changed, 9 insertions, 0 deletions
diff --git a/doc/classes/Shape3D.xml b/doc/classes/Shape3D.xml
index f8b749aebf..b5f70132d7 100644
--- a/doc/classes/Shape3D.xml
+++ b/doc/classes/Shape3D.xml
@@ -10,6 +10,13 @@
<link title="Physics introduction">https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link>
</tutorials>
<methods>
+ <method name="get_debug_mesh">
+ <return type="ArrayMesh">
+ </return>
+ <description>
+ Returns the [ArrayMesh] used to draw the debug collision for this [Shape3D].
+ </description>
+ </method>
</methods>
<members>
<member name="margin" type="float" setter="set_margin" getter="get_margin" default="0.04">
diff --git a/scene/resources/shape_3d.cpp b/scene/resources/shape_3d.cpp
index 5761a405ce..cb44e059a3 100644
--- a/scene/resources/shape_3d.cpp
+++ b/scene/resources/shape_3d.cpp
@@ -102,6 +102,8 @@ void Shape3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_margin", "margin"), &Shape3D::set_margin);
ClassDB::bind_method(D_METHOD("get_margin"), &Shape3D::get_margin);
+ ClassDB::bind_method(D_METHOD("get_debug_mesh"), &Shape3D::get_debug_mesh);
+
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0.001,10,0.001"), "set_margin", "get_margin");
}