Merge pull request #52369 from bengtsts/3.x

Expose soft body pin methods to GDScript
This commit is contained in:
Camille Mohr-Daurat 2021-09-17 06:19:54 -07:00 committed by GitHub
commit bb885c5704
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View file

@ -37,6 +37,20 @@
Returns an individual bit on the collision mask. Returns an individual bit on the collision mask.
</description> </description>
</method> </method>
<method name="get_point_transform">
<return type="Vector3" />
<argument index="0" name="point_index" type="int" />
<description>
Returns local translation of a vertex in the surface array.
</description>
</method>
<method name="is_point_pinned" qualifiers="const">
<return type="bool" />
<argument index="0" name="point_index" type="int" />
<description>
Returns [code]true[/code] if vertex is set to pinned.
</description>
</method>
<method name="remove_collision_exception_with"> <method name="remove_collision_exception_with">
<return type="void" /> <return type="void" />
<argument index="0" name="body" type="Node" /> <argument index="0" name="body" type="Node" />
@ -60,6 +74,15 @@
Sets individual bits on the collision mask. Use this if you only need to change one layer's value. Sets individual bits on the collision mask. Use this if you only need to change one layer's value.
</description> </description>
</method> </method>
<method name="set_point_pinned">
<return type="void" />
<argument index="0" name="point_index" type="int" />
<argument index="1" name="pinned" type="bool" />
<argument index="2" name="attachment_path" type="NodePath" default="NodePath(&quot;&quot;)" />
<description>
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.
</description>
</method>
</methods> </methods>
<members> <members>
<member name="areaAngular_stiffness" type="float" setter="set_areaAngular_stiffness" getter="get_areaAngular_stiffness" default="0.5"> <member name="areaAngular_stiffness" type="float" setter="set_areaAngular_stiffness" getter="get_areaAngular_stiffness" default="0.5">

View file

@ -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("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_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("set_ray_pickable", "ray_pickable"), &SoftBody::set_ray_pickable);
ClassDB::bind_method(D_METHOD("is_ray_pickable"), &SoftBody::is_ray_pickable); ClassDB::bind_method(D_METHOD("is_ray_pickable"), &SoftBody::is_ray_pickable);