PhysicalBone2D.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PhysicalBone2D" inherits="RigidDynamicBody2D" version="4.0">
  3. <brief_description>
  4. A 2D node that can be used for physically aware bones in 2D.
  5. </brief_description>
  6. <description>
  7. The [code]PhysicalBone2D[/code] node is a [RigidDynamicBody2D]-based node that can be used to make [Bone2D] nodes in a [Skeleton2D] react to physics. This node is very similar to the [PhysicalBone3D] node, just for 2D instead of 3D.
  8. [b]Note:[/b] To have the Bone2D nodes visually follow the [code]PhysicalBone2D[/code] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
  9. [b]Note:[/b] The PhysicalBone2D node does not automatically create a [Joint2D] node to keep [code]PhysicalBone2D[/code] nodes together. You will need to create these manually. For most cases, you want to use a [PinJoint2D] node. The [code]PhysicalBone2D[/code] node can automatically configure the [Joint2D] node once it's been created as a child node.
  10. </description>
  11. <tutorials>
  12. </tutorials>
  13. <methods>
  14. <method name="get_joint" qualifiers="const">
  15. <return type="Joint2D" />
  16. <description>
  17. Returns the first [Joint2D] child node, if one exists. This is mainly a helper function to make it easier to get the [Joint2D] that the [code]PhysicalBone2D[/code] is autoconfiguring.
  18. </description>
  19. </method>
  20. <method name="is_simulating_physics" qualifiers="const">
  21. <return type="bool" />
  22. <description>
  23. Returns a boolean that indicates whether the [code]PhysicalBone2D[/code] node is running and simulating using the Godot 2D physics engine. When [code]true[/code], the PhysicalBone2D node is using physics.
  24. </description>
  25. </method>
  26. </methods>
  27. <members>
  28. <member name="auto_configure_joint" type="bool" setter="set_auto_configure_joint" getter="get_auto_configure_joint" default="true">
  29. If [code]true[/code], the [code]PhysicalBone2D[/code] node will automatically configure the first [Joint2D] child node. The automatic configuration is limited to setting up the node properties and positioning the [Joint2D].
  30. </member>
  31. <member name="bone2d_index" type="int" setter="set_bone2d_index" getter="get_bone2d_index" default="-1">
  32. The index of the [Bone2D] node that this [code]PhysicalBone2D[/code] node is supposed to be simulating.
  33. </member>
  34. <member name="bone2d_nodepath" type="NodePath" setter="set_bone2d_nodepath" getter="get_bone2d_nodepath" default="NodePath(&quot;&quot;)">
  35. The [NodePath] to the [Bone2D] node that this [code]PhysicalBone2D[/code] node is supposed to be simulating.
  36. </member>
  37. <member name="follow_bone_when_simulating" type="bool" setter="set_follow_bone_when_simulating" getter="get_follow_bone_when_simulating" default="false">
  38. If [code]true[/code], the [code]PhysicalBone2D[/code] will keep the transform of the bone it is bound to when simulating physics.
  39. </member>
  40. <member name="simulate_physics" type="bool" setter="set_simulate_physics" getter="get_simulate_physics" default="false">
  41. If [code]true[/code], the [code]PhysicalBone2D[/code] will start simulating using physics. If [code]false[/code], the [code]PhysicalBone2D[/code] will follow the transform of the [Bone2D] node.
  42. [b]Note:[/b] To have the Bone2D nodes visually follow the [code]PhysicalBone2D[/code] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
  43. </member>
  44. </members>
  45. </class>