From 73b9b84995a17383e70fe1ce06d7e1bd05d92047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bengt=20S=C3=B6derstr=C3=B6m?= Date: Fri, 17 Sep 2021 11:25:31 +0200 Subject: [PATCH 1/2] Expose soft body pin methods to GDScript --- scene/3d/soft_body.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp index 78a6ef2c817..becd3f2f32f 100644 --- a/scene/3d/soft_body.cpp +++ b/scene/3d/soft_body.cpp @@ -365,6 +365,11 @@ void SoftBody::_bind_methods() { ClassDB::bind_method(D_METHOD("set_drag_coefficient", "drag_coefficient"), &SoftBody::set_drag_coefficient); ClassDB::bind_method(D_METHOD("get_drag_coefficient"), &SoftBody::get_drag_coefficient); + ClassDB::bind_method(D_METHOD("get_point_transform", "point_index"), &SoftBody::get_point_transform); + + ClassDB::bind_method(D_METHOD("set_point_pinned", "point_index", "pinned", "attachment_path"), &SoftBody::pin_point, DEFVAL(NodePath())); + ClassDB::bind_method(D_METHOD("is_point_pinned", "point_index"), &SoftBody::is_point_pinned); + ClassDB::bind_method(D_METHOD("set_ray_pickable", "ray_pickable"), &SoftBody::set_ray_pickable); ClassDB::bind_method(D_METHOD("is_ray_pickable"), &SoftBody::is_ray_pickable); From 2117584690488b48104b415f9bdb80d559203e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bengt=20S=C3=B6derstr=C3=B6m?= Date: Fri, 17 Sep 2021 11:25:53 +0200 Subject: [PATCH 2/2] Documented soft body pinning methods --- doc/classes/SoftBody.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/classes/SoftBody.xml b/doc/classes/SoftBody.xml index b840a022a33..5479fb6240d 100644 --- a/doc/classes/SoftBody.xml +++ b/doc/classes/SoftBody.xml @@ -37,6 +37,20 @@ Returns an individual bit on the collision mask. + + + + + Returns local translation of a vertex in the surface array. + + + + + + + Returns [code]true[/code] if vertex is set to pinned. + + @@ -60,6 +74,15 @@ Sets individual bits on the collision mask. Use this if you only need to change one layer's value. + + + + + + + Sets the pinned state of a surface vertex. When set to [code]true[/code], the optional [code]attachment_path[/code] can define a [Spatial] the pinned vertex will be attached to. + +