From 33a6c80abb6d0533d1676db61f5b8695449d6b4f Mon Sep 17 00:00:00 2001 From: Mikael Hermansson Date: Sat, 18 Mar 2023 17:17:11 +0100 Subject: [PATCH 1/2] Change documentation of `Shape3D.margin` to reflect current situation --- doc/classes/Shape3D.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/Shape3D.xml b/doc/classes/Shape3D.xml index dd75729ae908..dee428ccad8e 100644 --- a/doc/classes/Shape3D.xml +++ b/doc/classes/Shape3D.xml @@ -23,7 +23,7 @@ When set to [code]0[/code], the default value from [member ProjectSettings.physics/3d/solver/default_contact_bias] is used. - The collision margin for the shape. Used in Bullet Physics only. + The collision margin for the shape. This is not used in Godot Physics. Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp. From ec6694ce3c7ce53ee076ed5e6f0d08d1357a5381 Mon Sep 17 00:00:00 2001 From: Mikael Hermansson Date: Sat, 18 Mar 2023 17:19:21 +0100 Subject: [PATCH 2/2] Open up bounds of `Shape3D.margin` to support other physics engines --- scene/resources/shape_3d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/shape_3d.cpp b/scene/resources/shape_3d.cpp index 18a4001f3803..5a79392ba52e 100644 --- a/scene/resources/shape_3d.cpp +++ b/scene/resources/shape_3d.cpp @@ -117,7 +117,7 @@ void Shape3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_debug_mesh"), &Shape3D::get_debug_mesh); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "custom_solver_bias", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_custom_solver_bias", "get_custom_solver_bias"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0.001,10,0.001,suffix:m"), "set_margin", "get_margin"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "margin", PROPERTY_HINT_RANGE, "0,10,0.001,or_greater,suffix:m"), "set_margin", "get_margin"); } Shape3D::Shape3D() {