class_skeletonmodification2d.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SkeletonModification2D.xml.
  6. .. _class_SkeletonModification2D:
  7. SkeletonModification2D
  8. ======================
  9. **Experimental:** This class may be changed or removed in future versions.
  10. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  11. **Inherited By:** :ref:`SkeletonModification2DCCDIK<class_SkeletonModification2DCCDIK>`, :ref:`SkeletonModification2DFABRIK<class_SkeletonModification2DFABRIK>`, :ref:`SkeletonModification2DJiggle<class_SkeletonModification2DJiggle>`, :ref:`SkeletonModification2DLookAt<class_SkeletonModification2DLookAt>`, :ref:`SkeletonModification2DPhysicalBones<class_SkeletonModification2DPhysicalBones>`, :ref:`SkeletonModification2DStackHolder<class_SkeletonModification2DStackHolder>`, :ref:`SkeletonModification2DTwoBoneIK<class_SkeletonModification2DTwoBoneIK>`
  12. Base class for resources that operate on :ref:`Bone2D<class_Bone2D>`\ s in a :ref:`Skeleton2D<class_Skeleton2D>`.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. This resource provides an interface that can be expanded so code that operates on :ref:`Bone2D<class_Bone2D>` nodes in a :ref:`Skeleton2D<class_Skeleton2D>` can be mixed and matched together to create complex interactions.
  17. This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +-------------------------+-----------------------------------------------------------------------------+----------+
  24. | :ref:`bool<class_bool>` | :ref:`enabled<class_SkeletonModification2D_property_enabled>` | ``true`` |
  25. +-------------------------+-----------------------------------------------------------------------------+----------+
  26. | :ref:`int<class_int>` | :ref:`execution_mode<class_SkeletonModification2D_property_execution_mode>` | ``0`` |
  27. +-------------------------+-----------------------------------------------------------------------------+----------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | |void| | :ref:`_draw_editor_gizmo<class_SkeletonModification2D_private_method__draw_editor_gizmo>`\ (\ ) |virtual| |
  35. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | |void| | :ref:`_execute<class_SkeletonModification2D_private_method__execute>`\ (\ delta\: :ref:`float<class_float>`\ ) |virtual| |
  37. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | |void| | :ref:`_setup_modification<class_SkeletonModification2D_private_method__setup_modification>`\ (\ modification_stack\: :ref:`SkeletonModificationStack2D<class_SkeletonModificationStack2D>`\ ) |virtual| |
  39. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`clamp_angle<class_SkeletonModification2D_method_clamp_angle>`\ (\ angle\: :ref:`float<class_float>`, min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`, invert\: :ref:`bool<class_bool>`\ ) |
  41. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`get_editor_draw_gizmo<class_SkeletonModification2D_method_get_editor_draw_gizmo>`\ (\ ) |const| |
  43. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`get_is_setup<class_SkeletonModification2D_method_get_is_setup>`\ (\ ) |const| |
  45. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`SkeletonModificationStack2D<class_SkeletonModificationStack2D>` | :ref:`get_modification_stack<class_SkeletonModification2D_method_get_modification_stack>`\ (\ ) |
  47. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | |void| | :ref:`set_editor_draw_gizmo<class_SkeletonModification2D_method_set_editor_draw_gizmo>`\ (\ draw_gizmo\: :ref:`bool<class_bool>`\ ) |
  49. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | |void| | :ref:`set_is_setup<class_SkeletonModification2D_method_set_is_setup>`\ (\ is_setup\: :ref:`bool<class_bool>`\ ) |
  51. +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. .. rst-class:: classref-section-separator
  53. ----
  54. .. rst-class:: classref-descriptions-group
  55. Property Descriptions
  56. ---------------------
  57. .. _class_SkeletonModification2D_property_enabled:
  58. .. rst-class:: classref-property
  59. :ref:`bool<class_bool>` **enabled** = ``true`` :ref:`🔗<class_SkeletonModification2D_property_enabled>`
  60. .. rst-class:: classref-property-setget
  61. - |void| **set_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  62. - :ref:`bool<class_bool>` **get_enabled**\ (\ )
  63. If ``true``, the modification's :ref:`_execute<class_SkeletonModification2D_private_method__execute>` function will be called by the :ref:`SkeletonModificationStack2D<class_SkeletonModificationStack2D>`.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_SkeletonModification2D_property_execution_mode:
  67. .. rst-class:: classref-property
  68. :ref:`int<class_int>` **execution_mode** = ``0`` :ref:`🔗<class_SkeletonModification2D_property_execution_mode>`
  69. .. rst-class:: classref-property-setget
  70. - |void| **set_execution_mode**\ (\ value\: :ref:`int<class_int>`\ )
  71. - :ref:`int<class_int>` **get_execution_mode**\ (\ )
  72. The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only available in certain execution modes.
  73. .. rst-class:: classref-section-separator
  74. ----
  75. .. rst-class:: classref-descriptions-group
  76. Method Descriptions
  77. -------------------
  78. .. _class_SkeletonModification2D_private_method__draw_editor_gizmo:
  79. .. rst-class:: classref-method
  80. |void| **_draw_editor_gizmo**\ (\ ) |virtual| :ref:`🔗<class_SkeletonModification2D_private_method__draw_editor_gizmo>`
  81. Used for drawing **editor-only** modification gizmos. This function will only be called in the Godot editor and can be overridden to draw custom gizmos.
  82. \ **Note:** You will need to use the Skeleton2D from :ref:`SkeletonModificationStack2D.get_skeleton<class_SkeletonModificationStack2D_method_get_skeleton>` and it's draw functions, as the **SkeletonModification2D** resource cannot draw on its own.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_SkeletonModification2D_private_method__execute:
  86. .. rst-class:: classref-method
  87. |void| **_execute**\ (\ delta\: :ref:`float<class_float>`\ ) |virtual| :ref:`🔗<class_SkeletonModification2D_private_method__execute>`
  88. Executes the given modification. This is where the modification performs whatever function it is designed to do.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_SkeletonModification2D_private_method__setup_modification:
  92. .. rst-class:: classref-method
  93. |void| **_setup_modification**\ (\ modification_stack\: :ref:`SkeletonModificationStack2D<class_SkeletonModificationStack2D>`\ ) |virtual| :ref:`🔗<class_SkeletonModification2D_private_method__setup_modification>`
  94. Called when the modification is setup. This is where the modification performs initialization.
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_SkeletonModification2D_method_clamp_angle:
  98. .. rst-class:: classref-method
  99. :ref:`float<class_float>` **clamp_angle**\ (\ angle\: :ref:`float<class_float>`, min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`, invert\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_SkeletonModification2D_method_clamp_angle>`
  100. Takes an angle and clamps it so it is within the passed-in ``min`` and ``max`` range. ``invert`` will inversely clamp the angle, clamping it to the range outside of the given bounds.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_SkeletonModification2D_method_get_editor_draw_gizmo:
  104. .. rst-class:: classref-method
  105. :ref:`bool<class_bool>` **get_editor_draw_gizmo**\ (\ ) |const| :ref:`🔗<class_SkeletonModification2D_method_get_editor_draw_gizmo>`
  106. Returns whether this modification will call :ref:`_draw_editor_gizmo<class_SkeletonModification2D_private_method__draw_editor_gizmo>` in the Godot editor to draw modification-specific gizmos.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_SkeletonModification2D_method_get_is_setup:
  110. .. rst-class:: classref-method
  111. :ref:`bool<class_bool>` **get_is_setup**\ (\ ) |const| :ref:`🔗<class_SkeletonModification2D_method_get_is_setup>`
  112. Returns whether this modification has been successfully setup or not.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_SkeletonModification2D_method_get_modification_stack:
  116. .. rst-class:: classref-method
  117. :ref:`SkeletonModificationStack2D<class_SkeletonModificationStack2D>` **get_modification_stack**\ (\ ) :ref:`🔗<class_SkeletonModification2D_method_get_modification_stack>`
  118. Returns the :ref:`SkeletonModificationStack2D<class_SkeletonModificationStack2D>` that this modification is bound to. Through the modification stack, you can access the Skeleton2D the modification is operating on.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_SkeletonModification2D_method_set_editor_draw_gizmo:
  122. .. rst-class:: classref-method
  123. |void| **set_editor_draw_gizmo**\ (\ draw_gizmo\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_SkeletonModification2D_method_set_editor_draw_gizmo>`
  124. Sets whether this modification will call :ref:`_draw_editor_gizmo<class_SkeletonModification2D_private_method__draw_editor_gizmo>` in the Godot editor to draw modification-specific gizmos.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_SkeletonModification2D_method_set_is_setup:
  128. .. rst-class:: classref-method
  129. |void| **set_is_setup**\ (\ is_setup\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_SkeletonModification2D_method_set_is_setup>`
  130. Manually allows you to set the setup state of the modification. This function should only rarely be used, as the :ref:`SkeletonModificationStack2D<class_SkeletonModificationStack2D>` the modification is bound to should handle setting the modification up.
  131. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  132. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  133. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  134. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  135. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  136. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  137. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  138. .. |void| replace:: :abbr:`void (No return value.)`