class_skeletonmodification2dlookat.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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/SkeletonModification2DLookAt.xml.
  6. .. _class_SkeletonModification2DLookAt:
  7. SkeletonModification2DLookAt
  8. ============================
  9. **Experimental:** This class may be changed or removed in future versions.
  10. **Inherits:** :ref:`SkeletonModification2D<class_SkeletonModification2D>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  11. A modification that rotates a :ref:`Bone2D<class_Bone2D>` node to look at a target.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. This :ref:`SkeletonModification2D<class_SkeletonModification2D>` rotates a bone to look a target. This is extremely helpful for moving character's head to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------+-------------------------------------------------------------------------------------+------------------+
  22. | :ref:`NodePath<class_NodePath>` | :ref:`bone2d_node<class_SkeletonModification2DLookAt_property_bone2d_node>` | ``NodePath("")`` |
  23. +---------------------------------+-------------------------------------------------------------------------------------+------------------+
  24. | :ref:`int<class_int>` | :ref:`bone_index<class_SkeletonModification2DLookAt_property_bone_index>` | ``-1`` |
  25. +---------------------------------+-------------------------------------------------------------------------------------+------------------+
  26. | :ref:`NodePath<class_NodePath>` | :ref:`target_nodepath<class_SkeletonModification2DLookAt_property_target_nodepath>` | ``NodePath("")`` |
  27. +---------------------------------+-------------------------------------------------------------------------------------+------------------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`get_additional_rotation<class_SkeletonModification2DLookAt_method_get_additional_rotation>`\ (\ ) |const| |
  35. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`get_constraint_angle_invert<class_SkeletonModification2DLookAt_method_get_constraint_angle_invert>`\ (\ ) |const| |
  37. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`get_constraint_angle_max<class_SkeletonModification2DLookAt_method_get_constraint_angle_max>`\ (\ ) |const| |
  39. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`get_constraint_angle_min<class_SkeletonModification2DLookAt_method_get_constraint_angle_min>`\ (\ ) |const| |
  41. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`get_enable_constraint<class_SkeletonModification2DLookAt_method_get_enable_constraint>`\ (\ ) |const| |
  43. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | |void| | :ref:`set_additional_rotation<class_SkeletonModification2DLookAt_method_set_additional_rotation>`\ (\ rotation\: :ref:`float<class_float>`\ ) |
  45. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | |void| | :ref:`set_constraint_angle_invert<class_SkeletonModification2DLookAt_method_set_constraint_angle_invert>`\ (\ invert\: :ref:`bool<class_bool>`\ ) |
  47. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | |void| | :ref:`set_constraint_angle_max<class_SkeletonModification2DLookAt_method_set_constraint_angle_max>`\ (\ angle_max\: :ref:`float<class_float>`\ ) |
  49. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | |void| | :ref:`set_constraint_angle_min<class_SkeletonModification2DLookAt_method_set_constraint_angle_min>`\ (\ angle_min\: :ref:`float<class_float>`\ ) |
  51. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | |void| | :ref:`set_enable_constraint<class_SkeletonModification2DLookAt_method_set_enable_constraint>`\ (\ enable_constraint\: :ref:`bool<class_bool>`\ ) |
  53. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
  54. .. rst-class:: classref-section-separator
  55. ----
  56. .. rst-class:: classref-descriptions-group
  57. Property Descriptions
  58. ---------------------
  59. .. _class_SkeletonModification2DLookAt_property_bone2d_node:
  60. .. rst-class:: classref-property
  61. :ref:`NodePath<class_NodePath>` **bone2d_node** = ``NodePath("")`` :ref:`🔗<class_SkeletonModification2DLookAt_property_bone2d_node>`
  62. .. rst-class:: classref-property-setget
  63. - |void| **set_bone2d_node**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  64. - :ref:`NodePath<class_NodePath>` **get_bone2d_node**\ (\ )
  65. The :ref:`Bone2D<class_Bone2D>` node that the modification will operate on.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_SkeletonModification2DLookAt_property_bone_index:
  69. .. rst-class:: classref-property
  70. :ref:`int<class_int>` **bone_index** = ``-1`` :ref:`🔗<class_SkeletonModification2DLookAt_property_bone_index>`
  71. .. rst-class:: classref-property-setget
  72. - |void| **set_bone_index**\ (\ value\: :ref:`int<class_int>`\ )
  73. - :ref:`int<class_int>` **get_bone_index**\ (\ )
  74. The index of the :ref:`Bone2D<class_Bone2D>` node that the modification will operate on.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_SkeletonModification2DLookAt_property_target_nodepath:
  78. .. rst-class:: classref-property
  79. :ref:`NodePath<class_NodePath>` **target_nodepath** = ``NodePath("")`` :ref:`🔗<class_SkeletonModification2DLookAt_property_target_nodepath>`
  80. .. rst-class:: classref-property-setget
  81. - |void| **set_target_node**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  82. - :ref:`NodePath<class_NodePath>` **get_target_node**\ (\ )
  83. The NodePath to the node that is the target for the LookAt modification. This node is what the modification will rotate the :ref:`Bone2D<class_Bone2D>` to.
  84. .. rst-class:: classref-section-separator
  85. ----
  86. .. rst-class:: classref-descriptions-group
  87. Method Descriptions
  88. -------------------
  89. .. _class_SkeletonModification2DLookAt_method_get_additional_rotation:
  90. .. rst-class:: classref-method
  91. :ref:`float<class_float>` **get_additional_rotation**\ (\ ) |const| :ref:`🔗<class_SkeletonModification2DLookAt_method_get_additional_rotation>`
  92. Returns the amount of additional rotation that is applied after the LookAt modification executes.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_SkeletonModification2DLookAt_method_get_constraint_angle_invert:
  96. .. rst-class:: classref-method
  97. :ref:`bool<class_bool>` **get_constraint_angle_invert**\ (\ ) |const| :ref:`🔗<class_SkeletonModification2DLookAt_method_get_constraint_angle_invert>`
  98. Returns whether the constraints to this modification are inverted or not.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_SkeletonModification2DLookAt_method_get_constraint_angle_max:
  102. .. rst-class:: classref-method
  103. :ref:`float<class_float>` **get_constraint_angle_max**\ (\ ) |const| :ref:`🔗<class_SkeletonModification2DLookAt_method_get_constraint_angle_max>`
  104. Returns the constraint's maximum allowed angle.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_SkeletonModification2DLookAt_method_get_constraint_angle_min:
  108. .. rst-class:: classref-method
  109. :ref:`float<class_float>` **get_constraint_angle_min**\ (\ ) |const| :ref:`🔗<class_SkeletonModification2DLookAt_method_get_constraint_angle_min>`
  110. Returns the constraint's minimum allowed angle.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_SkeletonModification2DLookAt_method_get_enable_constraint:
  114. .. rst-class:: classref-method
  115. :ref:`bool<class_bool>` **get_enable_constraint**\ (\ ) |const| :ref:`🔗<class_SkeletonModification2DLookAt_method_get_enable_constraint>`
  116. Returns ``true`` if the LookAt modification is using constraints.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_SkeletonModification2DLookAt_method_set_additional_rotation:
  120. .. rst-class:: classref-method
  121. |void| **set_additional_rotation**\ (\ rotation\: :ref:`float<class_float>`\ ) :ref:`🔗<class_SkeletonModification2DLookAt_method_set_additional_rotation>`
  122. Sets the amount of additional rotation that is to be applied after executing the modification. This allows for offsetting the results by the inputted rotation amount.
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _class_SkeletonModification2DLookAt_method_set_constraint_angle_invert:
  126. .. rst-class:: classref-method
  127. |void| **set_constraint_angle_invert**\ (\ invert\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_SkeletonModification2DLookAt_method_set_constraint_angle_invert>`
  128. When ``true``, the modification will use an inverted joint constraint.
  129. An inverted joint constraint only constraints the :ref:`Bone2D<class_Bone2D>` to the angles *outside of* the inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint constraint, as it constraints the joint to the outside of the inputted values.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_SkeletonModification2DLookAt_method_set_constraint_angle_max:
  133. .. rst-class:: classref-method
  134. |void| **set_constraint_angle_max**\ (\ angle_max\: :ref:`float<class_float>`\ ) :ref:`🔗<class_SkeletonModification2DLookAt_method_set_constraint_angle_max>`
  135. Sets the constraint's maximum allowed angle.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_SkeletonModification2DLookAt_method_set_constraint_angle_min:
  139. .. rst-class:: classref-method
  140. |void| **set_constraint_angle_min**\ (\ angle_min\: :ref:`float<class_float>`\ ) :ref:`🔗<class_SkeletonModification2DLookAt_method_set_constraint_angle_min>`
  141. Sets the constraint's minimum allowed angle.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_SkeletonModification2DLookAt_method_set_enable_constraint:
  145. .. rst-class:: classref-method
  146. |void| **set_enable_constraint**\ (\ enable_constraint\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_SkeletonModification2DLookAt_method_set_enable_constraint>`
  147. Sets whether this modification will use constraints or not. When ``true``, constraints will be applied when solving the LookAt modification.
  148. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  149. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  150. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  151. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  152. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  153. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  154. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  155. .. |void| replace:: :abbr:`void (No return value.)`