SkeletonModification2DPhysicalBones.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SkeletonModification2DPhysicalBones" inherits="SkeletonModification2D" version="4.0">
  3. <brief_description>
  4. A modification that applies the transforms of [PhysicalBone2D] nodes to [Bone2D] nodes.
  5. </brief_description>
  6. <description>
  7. This modification takes the transforms of [PhysicalBone2D] nodes and applies them to [Bone2D] nodes. This allows the [Bone2D] nodes to react to physics thanks to the linked [PhysicalBone2D] nodes.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="fetch_physical_bones">
  13. <return type="void" />
  14. <description>
  15. Empties the list of [PhysicalBone2D] nodes and populates it will all [PhysicalBone2D] nodes that are children of the [Skeleton2D].
  16. </description>
  17. </method>
  18. <method name="get_physical_bone_node" qualifiers="const">
  19. <return type="NodePath" />
  20. <argument index="0" name="joint_idx" type="int" />
  21. <description>
  22. Returns the [PhysicalBone2D] node at [code]joint_idx[/code].
  23. </description>
  24. </method>
  25. <method name="set_physical_bone_node">
  26. <return type="void" />
  27. <argument index="0" name="joint_idx" type="int" />
  28. <argument index="1" name="physicalbone2d_node" type="NodePath" />
  29. <description>
  30. Sets the [PhysicalBone2D] node at [code]joint_idx[/code].
  31. [b]Note:[/b] This is just the index used for this modification, not the bone index used in the [Skeleton2D].
  32. </description>
  33. </method>
  34. <method name="start_simulation">
  35. <return type="void" />
  36. <argument index="0" name="bones" type="StringName[]" default="[]" />
  37. <description>
  38. Tell the [PhysicalBone2D] nodes to start simulating and interacting with the physics world.
  39. Optionally, an array of bone names can be passed to this function, and that will cause only [PhysicalBone2D] nodes with those names to start simulating.
  40. </description>
  41. </method>
  42. <method name="stop_simulation">
  43. <return type="void" />
  44. <argument index="0" name="bones" type="StringName[]" default="[]" />
  45. <description>
  46. Tell the [PhysicalBone2D] nodes to stop simulating and interacting with the physics world.
  47. Optionally, an array of bone names can be passed to this function, and that will cause only [PhysicalBone2D] nodes with those names to stop simulating.
  48. </description>
  49. </method>
  50. </methods>
  51. <members>
  52. <member name="physical_bone_chain_length" type="int" setter="set_physical_bone_chain_length" getter="get_physical_bone_chain_length" default="0">
  53. The amount of [PhysicalBone2D] nodes linked in this modification.
  54. </member>
  55. </members>
  56. </class>