SoftBody.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SoftBody" inherits="MeshInstance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. A soft mesh physics body.
  5. </brief_description>
  6. <description>
  7. A deformable physics body. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials.
  8. [b]Note:[/b] There are many known bugs in [SoftBody]. Therefore, it's not recommended to use them for things that can affect gameplay (such as a player character made entirely out of soft bodies).
  9. </description>
  10. <tutorials>
  11. <link>$DOCS_URL/tutorials/physics/soft_body.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="add_collision_exception_with">
  15. <return type="void" />
  16. <argument index="0" name="body" type="Node" />
  17. <description>
  18. Adds a body to the list of bodies that this body can't collide with.
  19. </description>
  20. </method>
  21. <method name="get_collision_exceptions">
  22. <return type="Array" />
  23. <description>
  24. Returns an array of nodes that were added as collision exceptions for this body.
  25. </description>
  26. </method>
  27. <method name="get_collision_layer_bit" qualifiers="const">
  28. <return type="bool" />
  29. <argument index="0" name="bit" type="int" />
  30. <description>
  31. Returns an individual bit on the collision mask.
  32. </description>
  33. </method>
  34. <method name="get_collision_mask_bit" qualifiers="const">
  35. <return type="bool" />
  36. <argument index="0" name="bit" type="int" />
  37. <description>
  38. Returns an individual bit on the collision mask.
  39. </description>
  40. </method>
  41. <method name="get_point_transform">
  42. <return type="Vector3" />
  43. <argument index="0" name="point_index" type="int" />
  44. <description>
  45. Returns local translation of a vertex in the surface array.
  46. </description>
  47. </method>
  48. <method name="is_point_pinned" qualifiers="const">
  49. <return type="bool" />
  50. <argument index="0" name="point_index" type="int" />
  51. <description>
  52. Returns [code]true[/code] if vertex is set to pinned.
  53. </description>
  54. </method>
  55. <method name="remove_collision_exception_with">
  56. <return type="void" />
  57. <argument index="0" name="body" type="Node" />
  58. <description>
  59. Removes a body from the list of bodies that this body can't collide with.
  60. </description>
  61. </method>
  62. <method name="set_collision_layer_bit">
  63. <return type="void" />
  64. <argument index="0" name="bit" type="int" />
  65. <argument index="1" name="value" type="bool" />
  66. <description>
  67. Sets individual bits on the layer mask. Use this if you only need to change one layer's value.
  68. </description>
  69. </method>
  70. <method name="set_collision_mask_bit">
  71. <return type="void" />
  72. <argument index="0" name="bit" type="int" />
  73. <argument index="1" name="value" type="bool" />
  74. <description>
  75. Sets individual bits on the collision mask. Use this if you only need to change one layer's value.
  76. </description>
  77. </method>
  78. <method name="set_point_pinned">
  79. <return type="void" />
  80. <argument index="0" name="point_index" type="int" />
  81. <argument index="1" name="pinned" type="bool" />
  82. <argument index="2" name="attachment_path" type="NodePath" default="NodePath(&quot;&quot;)" />
  83. <description>
  84. 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.
  85. </description>
  86. </method>
  87. </methods>
  88. <members>
  89. <member name="areaAngular_stiffness" type="float" setter="set_areaAngular_stiffness" getter="get_areaAngular_stiffness" default="0.5">
  90. </member>
  91. <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
  92. The physics layers this SoftBody is in.
  93. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property.
  94. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
  95. </member>
  96. <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
  97. The physics layers this SoftBody scans for collisions. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
  98. </member>
  99. <member name="damping_coefficient" type="float" setter="set_damping_coefficient" getter="get_damping_coefficient" default="0.01">
  100. </member>
  101. <member name="drag_coefficient" type="float" setter="set_drag_coefficient" getter="get_drag_coefficient" default="0.0">
  102. </member>
  103. <member name="linear_stiffness" type="float" setter="set_linear_stiffness" getter="get_linear_stiffness" default="0.5">
  104. </member>
  105. <member name="parent_collision_ignore" type="NodePath" setter="set_parent_collision_ignore" getter="get_parent_collision_ignore" default="NodePath(&quot;&quot;)">
  106. [NodePath] to a [CollisionObject] this SoftBody should avoid clipping.
  107. </member>
  108. <member name="physics_enabled" type="bool" setter="set_physics_enabled" getter="is_physics_enabled" default="true">
  109. If [code]true[/code], the [SoftBody] is simulated in physics. Can be set to [code]false[/code] to pause the physics simulation.
  110. </member>
  111. <member name="pose_matching_coefficient" type="float" setter="set_pose_matching_coefficient" getter="get_pose_matching_coefficient" default="0.0">
  112. </member>
  113. <member name="pressure_coefficient" type="float" setter="set_pressure_coefficient" getter="get_pressure_coefficient" default="0.0">
  114. </member>
  115. <member name="ray_pickable" type="bool" setter="set_ray_pickable" getter="is_ray_pickable" default="true">
  116. If [code]true[/code], the [SoftBody] will respond to [RayCast]s.
  117. </member>
  118. <member name="simulation_precision" type="int" setter="set_simulation_precision" getter="get_simulation_precision" default="5">
  119. Increasing this value will improve the resulting simulation, but can affect performance. Use with care.
  120. </member>
  121. <member name="total_mass" type="float" setter="set_total_mass" getter="get_total_mass" default="1.0">
  122. The SoftBody's mass.
  123. </member>
  124. <member name="volume_stiffness" type="float" setter="set_volume_stiffness" getter="get_volume_stiffness" default="0.5">
  125. </member>
  126. </members>
  127. <constants>
  128. </constants>
  129. </class>