class_skeletonmodification2dlookat.rst 12 KB

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