Debian Codegraph @

doc/classes/SoftBody3D.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="SoftBody3D" inherits="MeshInstance3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A deformable 3D physics mesh.
5 </brief_description>
6 <description>
7 A deformable 3D physics mesh. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials.
8 Additionally, [SoftBody3D] is subject to wind forces defined in [Area3D] (see [member Area3D.wind_source_path], [member Area3D.wind_force_magnitude], and [member Area3D.wind_attenuation_factor]).
9 [b]Note:[/b] It's recommended to use Jolt Physics when using [SoftBody3D] instead of the default GodotPhysics3D, as Jolt Physics' soft body implementation is faster and more reliable. You can switch the physics engine using the [member ProjectSettings.physics/3d/physics_engine] project setting.
10 </description>
11 <tutorials>
12 <link title="SoftBody">$DOCS_URL/tutorials/physics/soft_body.html</link>
13 </tutorials>
14 <methods>
15 <method name="add_collision_exception_with">
16 <return type="void" />
17 <param index="0" name="body" type="Node" />
18 <description>
19 Adds a body to the list of bodies that this body can't collide with.
20 </description>
21 </method>
22 <method name="apply_central_force">
23 <return type="void" />
24 <param index="0" name="force" type="Vector3" />
25 <description>
26 Distributes and applies a force to all points. A force is time dependent and meant to be applied every physics update.
27 </description>
28 </method>
29 <method name="apply_central_impulse">
30 <return type="void" />
31 <param index="0" name="impulse" type="Vector3" />
32 <description>
33 Distributes and applies an impulse to all points.
34 An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
35 </description>
36 </method>
37 <method name="apply_force">
38 <return type="void" />
39 <param index="0" name="point_index" type="int" />
40 <param index="1" name="force" type="Vector3" />
41 <description>
42 Applies a force to a point. A force is time dependent and meant to be applied every physics update.
43 </description>
44 </method>
45 <method name="apply_impulse">
46 <return type="void" />
47 <param index="0" name="point_index" type="int" />
48 <param index="1" name="impulse" type="Vector3" />
49 <description>
50 Applies an impulse to a point.
51 An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
52 </description>
53 </method>
54 <method name="get_collision_exceptions">
55 <return type="PhysicsBody3D[]" />
56 <description>
57 Returns an array of nodes that were added as collision exceptions for this body.
58 </description>
59 </method>
60 <method name="get_collision_layer_value" qualifiers="const">
61 <return type="bool" />
62 <param index="0" name="layer_number" type="int" />
63 <description>
64 Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [param layer_number] between 1 and 32.
65 </description>
66 </method>
67 <method name="get_collision_mask_value" qualifiers="const">
68 <return type="bool" />
69 <param index="0" name="layer_number" type="int" />
70 <description>
71 Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32.
72 </description>
73 </method>
74 <method name="get_physics_rid" qualifiers="const">
75 <return type="RID" />
76 <description>
77 Returns the internal [RID] used by the [PhysicsServer3D] for this body.
78 </description>
79 </method>
80 <method name="get_point_transform">
81 <return type="Vector3" />
82 <param index="0" name="point_index" type="int" />
83 <description>
84 Returns local translation of a vertex in the surface array.
85 </description>
86 </method>
87 <method name="is_point_pinned" qualifiers="const">
88 <return type="bool" />
89 <param index="0" name="point_index" type="int" />
90 <description>
91 Returns [code]true[/code] if vertex is set to pinned.
92 </description>
93 </method>
94 <method name="remove_collision_exception_with">
95 <return type="void" />
96 <param index="0" name="body" type="Node" />
97 <description>
98 Removes a body from the list of bodies that this body can't collide with.
99 </description>
100 </method>
101 <method name="set_collision_layer_value">
102 <return type="void" />
103 <param index="0" name="layer_number" type="int" />
104 <param index="1" name="value" type="bool" />
105 <description>
106 Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32.
107 </description>
108 </method>
109 <method name="set_collision_mask_value">
110 <return type="void" />
111 <param index="0" name="layer_number" type="int" />
112 <param index="1" name="value" type="bool" />
113 <description>
114 Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32.
115 </description>
116 </method>
117 <method name="set_point_pinned">
118 <return type="void" />
119 <param index="0" name="point_index" type="int" />
120 <param index="1" name="pinned" type="bool" />
121 <param index="2" name="attachment_path" type="NodePath" default="NodePath(&quot;&quot;)" />
122 <param index="3" name="insert_at" type="int" default="-1" />
123 <description>
124 Sets the pinned state of a surface vertex. When set to [code]true[/code], the optional [param attachment_path] can define a [Node3D] the pinned vertex will be attached to.
125 </description>
126 </method>
127 </methods>
128 <members>
129 <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
130 The physics layers this SoftBody3D [b]is in[/b]. Collision objects can exist in one or more of 32 different layers. See also [member collision_mask].
131 [b]Note:[/b] Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
132 </member>
133 <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
134 The physics layers this SoftBody3D [b]scans[/b]. Collision objects can scan one or more of 32 different layers. See also [member collision_layer].
135 [b]Note:[/b] Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
136 </member>
137 <member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01">
138 The body's damping coefficient. Higher values will slow down the body more noticeably when forces are applied.
139 </member>
140 <member name="disable_mode" type="int" setter="set_disable_mode" getter="get_disable_mode" enum="SoftBody3D.DisableMode" default="0">
141 Defines the behavior in physics when [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED].
142 </member>
143 <member name="drag_coefficient" type="float" setter="set_drag_coefficient" getter="get_drag_coefficient" default="0.0">
144 The body's drag coefficient. Higher values increase this body's air resistance.
145 [b]Note:[/b] This value is currently unused by Godot's default physics implementation.
146 </member>
147 <member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.5">
148 Higher values will result in a stiffer body, while lower values will increase the body's ability to bend. The value can be between [code]0.0[/code] and [code]1.0[/code] (inclusive).
149 </member>
150 <member name="parent_collision_ignore" type="NodePath" setter="set_parent_collision_ignore" getter="get_parent_collision_ignore" default="NodePath(&quot;&quot;)">
151 [NodePath] to a [CollisionObject3D] this SoftBody3D should avoid clipping.
152 </member>
153 <member name="pressure_coefficient" type="float" setter="set_pressure_coefficient" getter="get_pressure_coefficient" default="0.0">
154 The pressure coefficient of this soft body. Simulate pressure build-up from inside this body. Higher values increase the strength of this effect.
155 </member>
156 <member name="ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" default="true">
157 If [code]true[/code], the [SoftBody3D] will respond to [RayCast3D]s.
158 </member>
159 <member name="shrinking_factor" type="float" setter="set_shrinking_factor" getter="get_shrinking_factor" default="0.0">
160 Scales the rest lengths of [SoftBody3D]'s edge constraints. Positive values shrink the mesh, while negative values expand it. For example, a value of [code]0.1[/code] shortens the edges of the mesh by 10%, while [code]-0.1[/code] expands the edges by 10%.
161 [b]Note:[/b] [member shrinking_factor] is best used on surface meshes with pinned points.
162 </member>
163 <member name="simulation_precision" type="int" setter="set_simulation_precision" getter="get_simulation_precision" default="5">
164 Increasing this value will improve the resulting simulation, but can affect performance. Use with care.
165 </member>
166 <member name="total_mass" type="float" setter="set_total_mass" getter="get_total_mass" default="1.0">
167 The SoftBody3D's mass.
168 [b]Note:[/b] When using Jolt Physics, the default value of this property will instead be [code]0.0[/code], which will cause the body to automatically calculate the mass to 1 kg per point. This is a bug, which will be fixed in Godot 4.7.
169 </member>
170 </members>
171 <constants>
172 <constant name="DISABLE_MODE_REMOVE" value="0" enum="DisableMode">
173 When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], remove from the physics simulation to stop all physics interactions with this [SoftBody3D].
174 Automatically re-added to the physics simulation when the [Node] is processed again.
175 </constant>
176 <constant name="DISABLE_MODE_KEEP_ACTIVE" value="1" enum="DisableMode">
177 When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], do not affect the physics simulation.
178 </constant>
179 </constants>
180 </class>