mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
259 lines
12 KiB
ReStructuredText
259 lines
12 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SkeletonModification2DLookAt.xml.
|
|
|
|
.. _class_SkeletonModification2DLookAt:
|
|
|
|
SkeletonModification2DLookAt
|
|
============================
|
|
|
|
**Inherits:** :ref:`SkeletonModification2D<class_SkeletonModification2D>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
A modification that rotates a :ref:`Bone2D<class_Bone2D>` node to look at a target.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Description
|
|
-----------
|
|
|
|
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.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Properties
|
|
----------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------------+-------------------------------------------------------------------------------------+------------------+
|
|
| :ref:`NodePath<class_NodePath>` | :ref:`bone2d_node<class_SkeletonModification2DLookAt_property_bone2d_node>` | ``NodePath("")`` |
|
|
+---------------------------------+-------------------------------------------------------------------------------------+------------------+
|
|
| :ref:`int<class_int>` | :ref:`bone_index<class_SkeletonModification2DLookAt_property_bone_index>` | ``-1`` |
|
|
+---------------------------------+-------------------------------------------------------------------------------------+------------------+
|
|
| :ref:`NodePath<class_NodePath>` | :ref:`target_nodepath<class_SkeletonModification2DLookAt_property_target_nodepath>` | ``NodePath("")`` |
|
|
+---------------------------------+-------------------------------------------------------------------------------------+------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Methods
|
|
-------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_additional_rotation<class_SkeletonModification2DLookAt_method_get_additional_rotation>` **(** **)** |const| |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_constraint_angle_invert<class_SkeletonModification2DLookAt_method_get_constraint_angle_invert>` **(** **)** |const| |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_constraint_angle_max<class_SkeletonModification2DLookAt_method_get_constraint_angle_max>` **(** **)** |const| |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`float<class_float>` | :ref:`get_constraint_angle_min<class_SkeletonModification2DLookAt_method_get_constraint_angle_min>` **(** **)** |const| |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_enable_constraint<class_SkeletonModification2DLookAt_method_get_enable_constraint>` **(** **)** |const| |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_additional_rotation<class_SkeletonModification2DLookAt_method_set_additional_rotation>` **(** :ref:`float<class_float>` rotation **)** |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_constraint_angle_invert<class_SkeletonModification2DLookAt_method_set_constraint_angle_invert>` **(** :ref:`bool<class_bool>` invert **)** |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_constraint_angle_max<class_SkeletonModification2DLookAt_method_set_constraint_angle_max>` **(** :ref:`float<class_float>` angle_max **)** |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_constraint_angle_min<class_SkeletonModification2DLookAt_method_set_constraint_angle_min>` **(** :ref:`float<class_float>` angle_min **)** |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_enable_constraint<class_SkeletonModification2DLookAt_method_set_enable_constraint>` **(** :ref:`bool<class_bool>` enable_constraint **)** |
|
|
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_SkeletonModification2DLookAt_property_bone2d_node:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`NodePath<class_NodePath>` **bone2d_node** = ``NodePath("")``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_bone2d_node** **(** :ref:`NodePath<class_NodePath>` value **)**
|
|
- :ref:`NodePath<class_NodePath>` **get_bone2d_node** **(** **)**
|
|
|
|
The :ref:`Bone2D<class_Bone2D>` node that the modification will operate on.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_property_bone_index:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **bone_index** = ``-1``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_bone_index** **(** :ref:`int<class_int>` value **)**
|
|
- :ref:`int<class_int>` **get_bone_index** **(** **)**
|
|
|
|
The index of the :ref:`Bone2D<class_Bone2D>` node that the modification will oeprate on.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_property_target_nodepath:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`NodePath<class_NodePath>` **target_nodepath** = ``NodePath("")``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_target_node** **(** :ref:`NodePath<class_NodePath>` value **)**
|
|
- :ref:`NodePath<class_NodePath>` **get_target_node** **(** **)**
|
|
|
|
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.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_get_additional_rotation:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_additional_rotation** **(** **)** |const|
|
|
|
|
Returns the amount of additional rotation that is applied after the LookAt modification executes.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_get_constraint_angle_invert:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **get_constraint_angle_invert** **(** **)** |const|
|
|
|
|
Returns whether the constraints to this modification are inverted or not.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_get_constraint_angle_max:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_constraint_angle_max** **(** **)** |const|
|
|
|
|
Returns the constraint's maximum allowed angle.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_get_constraint_angle_min:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_constraint_angle_min** **(** **)** |const|
|
|
|
|
Returns the constraint's minimum allowed angle.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_get_enable_constraint:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **get_enable_constraint** **(** **)** |const|
|
|
|
|
Returns ``true`` if the LookAt modification is using constraints.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_set_additional_rotation:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_additional_rotation** **(** :ref:`float<class_float>` rotation **)**
|
|
|
|
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.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_set_constraint_angle_invert:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_constraint_angle_invert** **(** :ref:`bool<class_bool>` invert **)**
|
|
|
|
When ``true``, the modification will use an inverted joint constraint.
|
|
|
|
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.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_set_constraint_angle_max:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_constraint_angle_max** **(** :ref:`float<class_float>` angle_max **)**
|
|
|
|
Sets the constraint's maximum allowed angle.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_set_constraint_angle_min:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_constraint_angle_min** **(** :ref:`float<class_float>` angle_min **)**
|
|
|
|
Sets the constraint's minimum allowed angle.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModification2DLookAt_method_set_enable_constraint:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_enable_constraint** **(** :ref:`bool<class_bool>` enable_constraint **)**
|
|
|
|
Sets whether this modification will use constraints or not. When ``true``, constraints will be applied when solving the LookAt modification.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|
|
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
|
|
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
|
|
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|