class_skeletonmodification3dlookat.rst 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the SkeletonModification3DLookAt.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_SkeletonModification3DLookAt:
  6. SkeletonModification3DLookAt
  7. ============================
  8. **Inherits:** :ref:`SkeletonModification3D<class_SkeletonModification3D>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. A modification that rotates a bone to look at a target.
  10. Description
  11. -----------
  12. This :ref:`SkeletonModification3D<class_SkeletonModification3D>` rotates a bone to look a target. This is extremely helpful for moving character's heads 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.
  13. Properties
  14. ----------
  15. +---------------------------------+-------------------------------------------------------------------------------------+------------------+
  16. | :ref:`int<class_int>` | :ref:`bone_index<class_SkeletonModification3DLookAt_property_bone_index>` | ``-2`` |
  17. +---------------------------------+-------------------------------------------------------------------------------------+------------------+
  18. | :ref:`String<class_String>` | :ref:`bone_name<class_SkeletonModification3DLookAt_property_bone_name>` | ``""`` |
  19. +---------------------------------+-------------------------------------------------------------------------------------+------------------+
  20. | :ref:`NodePath<class_NodePath>` | :ref:`target_nodepath<class_SkeletonModification3DLookAt_property_target_nodepath>` | ``NodePath("")`` |
  21. +---------------------------------+-------------------------------------------------------------------------------------+------------------+
  22. Methods
  23. -------
  24. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Vector3<class_Vector3>` | :ref:`get_additional_rotation<class_SkeletonModification3DLookAt_method_get_additional_rotation>` **(** **)** |const| |
  26. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_lock_rotation_plane<class_SkeletonModification3DLookAt_method_get_lock_rotation_plane>` **(** **)** |const| |
  28. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`get_lock_rotation_to_plane<class_SkeletonModification3DLookAt_method_get_lock_rotation_to_plane>` **(** **)** |const| |
  30. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`set_additional_rotation<class_SkeletonModification3DLookAt_method_set_additional_rotation>` **(** :ref:`Vector3<class_Vector3>` additional_rotation **)** |
  32. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_lock_rotation_plane<class_SkeletonModification3DLookAt_method_set_lock_rotation_plane>` **(** :ref:`int<class_int>` plane **)** |
  34. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_lock_rotation_to_plane<class_SkeletonModification3DLookAt_method_set_lock_rotation_to_plane>` **(** :ref:`bool<class_bool>` lock_to_plane **)** |
  36. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. Property Descriptions
  38. ---------------------
  39. .. _class_SkeletonModification3DLookAt_property_bone_index:
  40. - :ref:`int<class_int>` **bone_index**
  41. +-----------+-----------------------+
  42. | *Default* | ``-2`` |
  43. +-----------+-----------------------+
  44. | *Setter* | set_bone_index(value) |
  45. +-----------+-----------------------+
  46. | *Getter* | get_bone_index() |
  47. +-----------+-----------------------+
  48. The bone index of the bone that should be operated on by this modification.
  49. When possible, this will also update the :ref:`bone_name<class_SkeletonModification3DLookAt_property_bone_name>` based on data provided by the :ref:`Skeleton3D<class_Skeleton3D>`.
  50. ----
  51. .. _class_SkeletonModification3DLookAt_property_bone_name:
  52. - :ref:`String<class_String>` **bone_name**
  53. +-----------+----------------------+
  54. | *Default* | ``""`` |
  55. +-----------+----------------------+
  56. | *Setter* | set_bone_name(value) |
  57. +-----------+----------------------+
  58. | *Getter* | get_bone_name() |
  59. +-----------+----------------------+
  60. The name of the bone that should be operated on by this modification.
  61. When possible, this will also update the :ref:`bone_index<class_SkeletonModification3DLookAt_property_bone_index>` based on data provided by the :ref:`Skeleton3D<class_Skeleton3D>`.
  62. ----
  63. .. _class_SkeletonModification3DLookAt_property_target_nodepath:
  64. - :ref:`NodePath<class_NodePath>` **target_nodepath**
  65. +-----------+------------------------+
  66. | *Default* | ``NodePath("")`` |
  67. +-----------+------------------------+
  68. | *Setter* | set_target_node(value) |
  69. +-----------+------------------------+
  70. | *Getter* | get_target_node() |
  71. +-----------+------------------------+
  72. The NodePath to the node that is the target for the modification.
  73. Method Descriptions
  74. -------------------
  75. .. _class_SkeletonModification3DLookAt_method_get_additional_rotation:
  76. - :ref:`Vector3<class_Vector3>` **get_additional_rotation** **(** **)** |const|
  77. Returns the amount of extra rotation that is applied to the bone after the LookAt modification executes.
  78. ----
  79. .. _class_SkeletonModification3DLookAt_method_get_lock_rotation_plane:
  80. - :ref:`int<class_int>` **get_lock_rotation_plane** **(** **)** |const|
  81. Returns the plane that the LookAt modification is limiting rotation to.
  82. ----
  83. .. _class_SkeletonModification3DLookAt_method_get_lock_rotation_to_plane:
  84. - :ref:`bool<class_bool>` **get_lock_rotation_to_plane** **(** **)** |const|
  85. Returns whether the LookAt modification is limiting rotation to a single plane in 3D space.
  86. ----
  87. .. _class_SkeletonModification3DLookAt_method_set_additional_rotation:
  88. - void **set_additional_rotation** **(** :ref:`Vector3<class_Vector3>` additional_rotation **)**
  89. Sets the amount of extra rotation to be applied after the LookAt modification executes. This allows you to adjust the finished result.
  90. ----
  91. .. _class_SkeletonModification3DLookAt_method_set_lock_rotation_plane:
  92. - void **set_lock_rotation_plane** **(** :ref:`int<class_int>` plane **)**
  93. ----
  94. .. _class_SkeletonModification3DLookAt_method_set_lock_rotation_to_plane:
  95. - void **set_lock_rotation_to_plane** **(** :ref:`bool<class_bool>` lock_to_plane **)**
  96. When ``true``, the LookAt modification will limit its rotation to a single plane in 3D space. The plane used can be configured using the ``set_lock_rotation_plane`` function.
  97. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  98. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  99. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  100. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  101. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  102. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`