Files
godot-docs-l10n/classes/zh_CN/class_lookatmodifier3d.rst

720 lines
35 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.4/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.4/doc/classes/LookAtModifier3D.xml.
.. _class_LookAtModifier3D:
LookAtModifier3D
================
**继承:** :ref:`SkeletonModifier3D<class_SkeletonModifier3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
**LookAtModifier3D** 会旋转骨骼,让它看向某个目标。
.. rst-class:: classref-introduction-group
描述
----
:ref:`SkeletonModifier3D<class_SkeletonModifier3D>` 会旋转骨骼,让它看向某个目标。适用于让角色的头部看向玩家、让炮塔看向目标等需要让骨骼简单快速地旋转到指向某个物体的情况。
应用多个 **LookAtModifier3D** 时,分配给父骨骼的 **LookAtModifier3D** 在列表中必须放在分配给子骨骼的 **LookAtModifier3D** 上方,这样才能让子骨骼得到正确的结果。
.. rst-class:: classref-reftable-group
属性
----
.. table::
:widths: auto
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`int<class_int>` | :ref:`bone<class_LookAtModifier3D_property_bone>` | ``-1`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`String<class_String>` | :ref:`bone_name<class_LookAtModifier3D_property_bone_name>` | ``""`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`duration<class_LookAtModifier3D_property_duration>` | ``0.0`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`EaseType<enum_Tween_EaseType>` | :ref:`ease_type<class_LookAtModifier3D_property_ease_type>` | ``0`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` | :ref:`forward_axis<class_LookAtModifier3D_property_forward_axis>` | ``4`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`int<class_int>` | :ref:`origin_bone<class_LookAtModifier3D_property_origin_bone>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`String<class_String>` | :ref:`origin_bone_name<class_LookAtModifier3D_property_origin_bone_name>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`origin_external_node<class_LookAtModifier3D_property_origin_external_node>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`OriginFrom<enum_LookAtModifier3D_OriginFrom>` | :ref:`origin_from<class_LookAtModifier3D_property_origin_from>` | ``0`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`origin_offset<class_LookAtModifier3D_property_origin_offset>` | ``Vector3(0, 0, 0)`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`origin_safe_margin<class_LookAtModifier3D_property_origin_safe_margin>` | ``0.1`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`primary_damp_threshold<class_LookAtModifier3D_property_primary_damp_threshold>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`primary_limit_angle<class_LookAtModifier3D_property_primary_limit_angle>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`primary_negative_damp_threshold<class_LookAtModifier3D_property_primary_negative_damp_threshold>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`primary_negative_limit_angle<class_LookAtModifier3D_property_primary_negative_limit_angle>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`primary_positive_damp_threshold<class_LookAtModifier3D_property_primary_positive_damp_threshold>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`primary_positive_limit_angle<class_LookAtModifier3D_property_primary_positive_limit_angle>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`Axis<enum_Vector3_Axis>` | :ref:`primary_rotation_axis<class_LookAtModifier3D_property_primary_rotation_axis>` | ``1`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`secondary_damp_threshold<class_LookAtModifier3D_property_secondary_damp_threshold>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`secondary_limit_angle<class_LookAtModifier3D_property_secondary_limit_angle>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`secondary_negative_damp_threshold<class_LookAtModifier3D_property_secondary_negative_damp_threshold>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`secondary_negative_limit_angle<class_LookAtModifier3D_property_secondary_negative_limit_angle>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`secondary_positive_damp_threshold<class_LookAtModifier3D_property_secondary_positive_damp_threshold>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`float<class_float>` | :ref:`secondary_positive_limit_angle<class_LookAtModifier3D_property_secondary_positive_limit_angle>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`bool<class_bool>` | :ref:`symmetry_limitation<class_LookAtModifier3D_property_symmetry_limitation>` | |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`target_node<class_LookAtModifier3D_property_target_node>` | ``NodePath("")`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`TransitionType<enum_Tween_TransitionType>` | :ref:`transition_type<class_LookAtModifier3D_property_transition_type>` | ``0`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`bool<class_bool>` | :ref:`use_angle_limitation<class_LookAtModifier3D_property_use_angle_limitation>` | ``false`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
| :ref:`bool<class_bool>` | :ref:`use_secondary_rotation<class_LookAtModifier3D_property_use_secondary_rotation>` | ``true`` |
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------+----------------------+
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+---------------------------+-------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_interpolation_remaining<class_LookAtModifier3D_method_get_interpolation_remaining>`\ (\ ) |const| |
+---------------------------+-------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_interpolating<class_LookAtModifier3D_method_is_interpolating>`\ (\ ) |const| |
+---------------------------+-------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_target_within_limitation<class_LookAtModifier3D_method_is_target_within_limitation>`\ (\ ) |const| |
+---------------------------+-------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
枚举
----
.. _enum_LookAtModifier3D_OriginFrom:
.. rst-class:: classref-enumeration
enum **OriginFrom**: :ref:`🔗<enum_LookAtModifier3D_OriginFrom>`
.. _class_LookAtModifier3D_constant_ORIGIN_FROM_SELF:
.. rst-class:: classref-enumeration-constant
:ref:`OriginFrom<enum_LookAtModifier3D_OriginFrom>` **ORIGIN_FROM_SELF** = ``0``
使用 :ref:`bone<class_LookAtModifier3D_property_bone>` 所指定骨骼的放松位置作为原点。
.. _class_LookAtModifier3D_constant_ORIGIN_FROM_SPECIFIC_BONE:
.. rst-class:: classref-enumeration-constant
:ref:`OriginFrom<enum_LookAtModifier3D_OriginFrom>` **ORIGIN_FROM_SPECIFIC_BONE** = ``1``
使用 :ref:`origin_bone<class_LookAtModifier3D_property_origin_bone>` 所指定骨骼的全局姿势位置作为原点。
\ **注意:**\ 除非你熟悉骨骼的处理流程,否则建议只选择父级骨骼。指定骨骼姿势在处理 **LookAtModifier3D** 时会用作参考。换句话说,如果你指定的是子级骨骼,而 **LookAtModifier3D** 导致该子级骨骼发生移动,那么渲染结果会与方向不一致。
.. _class_LookAtModifier3D_constant_ORIGIN_FROM_EXTERNAL_NODE:
.. rst-class:: classref-enumeration-constant
:ref:`OriginFrom<enum_LookAtModifier3D_OriginFrom>` **ORIGIN_FROM_EXTERNAL_NODE** = ``2``
使用 :ref:`origin_external_node<class_LookAtModifier3D_property_origin_external_node>` 所指定的 :ref:`Node3D<class_Node3D>` 的全局位置作为原点。
\ **注意:**\ 与 :ref:`ORIGIN_FROM_SPECIFIC_BONE<class_LookAtModifier3D_constant_ORIGIN_FROM_SPECIFIC_BONE>` 相同,如果指定的是分配了子级骨骼的 :ref:`BoneAttachment3D<class_BoneAttachment3D>`\ ,那么渲染结果会与方向不一致。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
属性说明
--------
.. _class_LookAtModifier3D_property_bone:
.. rst-class:: classref-property
:ref:`int<class_int>` **bone** = ``-1`` :ref:`🔗<class_LookAtModifier3D_property_bone>`
.. rst-class:: classref-property-setget
- |void| **set_bone**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_bone**\ (\ )
父级 :ref:`Skeleton3D<class_Skeleton3D>`:ref:`bone_name<class_LookAtModifier3D_property_bone_name>` 的索引。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_bone_name:
.. rst-class:: classref-property
:ref:`String<class_String>` **bone_name** = ``""`` :ref:`🔗<class_LookAtModifier3D_property_bone_name>`
.. rst-class:: classref-property-setget
- |void| **set_bone_name**\ (\ value\: :ref:`String<class_String>`\ )
- :ref:`String<class_String>` **get_bone_name**\ (\ )
:ref:`Skeleton3D<class_Skeleton3D>` 中要执行修改的骨骼名称。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_duration:
.. rst-class:: classref-property
:ref:`float<class_float>` **duration** = ``0.0`` :ref:`🔗<class_LookAtModifier3D_property_duration>`
.. rst-class:: classref-property-setget
- |void| **set_duration**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_duration**\ (\ )
基于时间的插值的持续时间。插值的触发条件有:
- 目标节点发生改变
- 由于角度限制导致轴发生翻转
\ **注意:**\ 翻转的时机是目标超出角度限制范围,前进向量的内部次旋转轴发生翻转。视觉上,发生的时机是目标超出角度限制范围,越过 :ref:`forward_axis<class_LookAtModifier3D_property_forward_axis>`:ref:`primary_rotation_axis<class_LookAtModifier3D_property_primary_rotation_axis>` 构成的平面。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_ease_type:
.. rst-class:: classref-property
:ref:`EaseType<enum_Tween_EaseType>` **ease_type** = ``0`` :ref:`🔗<class_LookAtModifier3D_property_ease_type>`
.. rst-class:: classref-property-setget
- |void| **set_ease_type**\ (\ value\: :ref:`EaseType<enum_Tween_EaseType>`\ )
- :ref:`EaseType<enum_Tween_EaseType>` **get_ease_type**\ (\ )
基于时间的插值的缓动类型。另见 :ref:`EaseType<enum_Tween_EaseType>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_forward_axis:
.. rst-class:: classref-property
:ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **forward_axis** = ``4`` :ref:`🔗<class_LookAtModifier3D_property_forward_axis>`
.. rst-class:: classref-property-setget
- |void| **set_forward_axis**\ (\ value\: :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>`\ )
- :ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **get_forward_axis**\ (\ )
骨骼的前进轴。该 :ref:`SkeletonModifier3D<class_SkeletonModifier3D>` 对骨骼进行的修改会让该轴指向 :ref:`target_node<class_LookAtModifier3D_property_target_node>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_origin_bone:
.. rst-class:: classref-property
:ref:`int<class_int>` **origin_bone** :ref:`🔗<class_LookAtModifier3D_property_origin_bone>`
.. rst-class:: classref-property-setget
- |void| **set_origin_bone**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_origin_bone**\ (\ )
父级 :ref:`Skeleton3D<class_Skeleton3D>`:ref:`origin_bone_name<class_LookAtModifier3D_property_origin_bone_name>` 的索引。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_origin_bone_name:
.. rst-class:: classref-property
:ref:`String<class_String>` **origin_bone_name** :ref:`🔗<class_LookAtModifier3D_property_origin_bone_name>`
.. rst-class:: classref-property-setget
- |void| **set_origin_bone_name**\ (\ value\: :ref:`String<class_String>`\ )
- :ref:`String<class_String>` **get_origin_bone_name**\ (\ )
如果 :ref:`origin_from<class_LookAtModifier3D_property_origin_from>`:ref:`ORIGIN_FROM_SPECIFIC_BONE<class_LookAtModifier3D_constant_ORIGIN_FROM_SPECIFIC_BONE>`\ ,则会将指定的骨骼全局姿势位置用作原点。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_origin_external_node:
.. rst-class:: classref-property
:ref:`NodePath<class_NodePath>` **origin_external_node** :ref:`🔗<class_LookAtModifier3D_property_origin_external_node>`
.. rst-class:: classref-property-setget
- |void| **set_origin_external_node**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
- :ref:`NodePath<class_NodePath>` **get_origin_external_node**\ (\ )
如果 :ref:`origin_from<class_LookAtModifier3D_property_origin_from>`:ref:`ORIGIN_FROM_EXTERNAL_NODE<class_LookAtModifier3D_constant_ORIGIN_FROM_EXTERNAL_NODE>`\ ,则会将指定的 :ref:`Node3D<class_Node3D>` 的全局位置用作原点。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_origin_from:
.. rst-class:: classref-property
:ref:`OriginFrom<enum_LookAtModifier3D_OriginFrom>` **origin_from** = ``0`` :ref:`🔗<class_LookAtModifier3D_property_origin_from>`
.. rst-class:: classref-property-setget
- |void| **set_origin_from**\ (\ value\: :ref:`OriginFrom<enum_LookAtModifier3D_OriginFrom>`\ )
- :ref:`OriginFrom<enum_LookAtModifier3D_OriginFrom>` **get_origin_from**\ (\ )
该值决定了计算前进向量时从哪里获取原点。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_origin_offset:
.. rst-class:: classref-property
:ref:`Vector3<class_Vector3>` **origin_offset** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_LookAtModifier3D_property_origin_offset>`
.. rst-class:: classref-property-setget
- |void| **set_origin_offset**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
- :ref:`Vector3<class_Vector3>` **get_origin_offset**\ (\ )
骨骼姿势原点的偏移。通过偏移量来对齐原点常用于多个骨骼必须始终朝向同一方向的情况,例如眼球。
\ **注意:**\ 该值表示的是 :ref:`origin_from<class_LookAtModifier3D_property_origin_from>` 中设置的对象的局部位置。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_origin_safe_margin:
.. rst-class:: classref-property
:ref:`float<class_float>` **origin_safe_margin** = ``0.1`` :ref:`🔗<class_LookAtModifier3D_property_origin_safe_margin>`
.. rst-class:: classref-property-setget
- |void| **set_origin_safe_margin**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_origin_safe_margin**\ (\ )
如果目标经过原点的距离小于该值,即使目标在角度限制范围内,也会使用基于时间的插值,从而防止角速度过高。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_primary_damp_threshold:
.. rst-class:: classref-property
:ref:`float<class_float>` **primary_damp_threshold** :ref:`🔗<class_LookAtModifier3D_property_primary_damp_threshold>`
.. rst-class:: classref-property-setget
- |void| **set_primary_damp_threshold**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_primary_damp_threshold**\ (\ )
开始对 :ref:`primary_limit_angle<class_LookAtModifier3D_property_primary_limit_angle>` 执行阻尼的阈值。提供的是非线性B 样条)插值,会使得在旋转到边缘限制时感受到更多的阻力。适用于模拟人类运动的限制。
如果为 ``1.0`` 则不执行阻尼。如果为 ``0.0`` 则始终执行阻尼。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_primary_limit_angle:
.. rst-class:: classref-property
:ref:`float<class_float>` **primary_limit_angle** :ref:`🔗<class_LookAtModifier3D_property_primary_limit_angle>`
.. rst-class:: classref-property-setget
- |void| **set_primary_limit_angle**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_primary_limit_angle**\ (\ )
:ref:`symmetry_limitation<class_LookAtModifier3D_property_symmetry_limitation>```true`` 时,主旋转的限制角度。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_primary_negative_damp_threshold:
.. rst-class:: classref-property
:ref:`float<class_float>` **primary_negative_damp_threshold** :ref:`🔗<class_LookAtModifier3D_property_primary_negative_damp_threshold>`
.. rst-class:: classref-property-setget
- |void| **set_primary_negative_damp_threshold**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_primary_negative_damp_threshold**\ (\ )
开始对 :ref:`primary_negative_limit_angle<class_LookAtModifier3D_property_primary_negative_limit_angle>` 执行阻尼的阈值。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_primary_negative_limit_angle:
.. rst-class:: classref-property
:ref:`float<class_float>` **primary_negative_limit_angle** :ref:`🔗<class_LookAtModifier3D_property_primary_negative_limit_angle>`
.. rst-class:: classref-property-setget
- |void| **set_primary_negative_limit_angle**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_primary_negative_limit_angle**\ (\ )
:ref:`symmetry_limitation<class_LookAtModifier3D_property_symmetry_limitation>```false`` 时,主旋转负方向的限制角度。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_primary_positive_damp_threshold:
.. rst-class:: classref-property
:ref:`float<class_float>` **primary_positive_damp_threshold** :ref:`🔗<class_LookAtModifier3D_property_primary_positive_damp_threshold>`
.. rst-class:: classref-property-setget
- |void| **set_primary_positive_damp_threshold**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_primary_positive_damp_threshold**\ (\ )
开始对 :ref:`primary_positive_limit_angle<class_LookAtModifier3D_property_primary_positive_limit_angle>` 执行阻尼的阈值。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_primary_positive_limit_angle:
.. rst-class:: classref-property
:ref:`float<class_float>` **primary_positive_limit_angle** :ref:`🔗<class_LookAtModifier3D_property_primary_positive_limit_angle>`
.. rst-class:: classref-property-setget
- |void| **set_primary_positive_limit_angle**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_primary_positive_limit_angle**\ (\ )
:ref:`symmetry_limitation<class_LookAtModifier3D_property_symmetry_limitation>```false`` 时,主旋转正方向的限制角度。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_primary_rotation_axis:
.. rst-class:: classref-property
:ref:`Axis<enum_Vector3_Axis>` **primary_rotation_axis** = ``1`` :ref:`🔗<class_LookAtModifier3D_property_primary_rotation_axis>`
.. rst-class:: classref-property-setget
- |void| **set_primary_rotation_axis**\ (\ value\: :ref:`Axis<enum_Vector3_Axis>`\ )
- :ref:`Axis<enum_Vector3_Axis>` **get_primary_rotation_axis**\ (\ )
主旋转轴。该 :ref:`SkeletonModifier3D<class_SkeletonModifier3D>` 会使用欧拉角对旋转进行合成,防止围绕 :ref:`forward_axis<class_LookAtModifier3D_property_forward_axis>` 旋转。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_secondary_damp_threshold:
.. rst-class:: classref-property
:ref:`float<class_float>` **secondary_damp_threshold** :ref:`🔗<class_LookAtModifier3D_property_secondary_damp_threshold>`
.. rst-class:: classref-property-setget
- |void| **set_secondary_damp_threshold**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_secondary_damp_threshold**\ (\ )
开始对 :ref:`secondary_limit_angle<class_LookAtModifier3D_property_secondary_limit_angle>` 执行阻尼的阈值。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_secondary_limit_angle:
.. rst-class:: classref-property
:ref:`float<class_float>` **secondary_limit_angle** :ref:`🔗<class_LookAtModifier3D_property_secondary_limit_angle>`
.. rst-class:: classref-property-setget
- |void| **set_secondary_limit_angle**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_secondary_limit_angle**\ (\ )
:ref:`symmetry_limitation<class_LookAtModifier3D_property_symmetry_limitation>```true`` 时,次旋转的限制角度。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_secondary_negative_damp_threshold:
.. rst-class:: classref-property
:ref:`float<class_float>` **secondary_negative_damp_threshold** :ref:`🔗<class_LookAtModifier3D_property_secondary_negative_damp_threshold>`
.. rst-class:: classref-property-setget
- |void| **set_secondary_negative_damp_threshold**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_secondary_negative_damp_threshold**\ (\ )
开始对 :ref:`secondary_negative_limit_angle<class_LookAtModifier3D_property_secondary_negative_limit_angle>` 执行阻尼的阈值。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_secondary_negative_limit_angle:
.. rst-class:: classref-property
:ref:`float<class_float>` **secondary_negative_limit_angle** :ref:`🔗<class_LookAtModifier3D_property_secondary_negative_limit_angle>`
.. rst-class:: classref-property-setget
- |void| **set_secondary_negative_limit_angle**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_secondary_negative_limit_angle**\ (\ )
:ref:`symmetry_limitation<class_LookAtModifier3D_property_symmetry_limitation>```false`` 时,次旋转负方向的限制角度。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_secondary_positive_damp_threshold:
.. rst-class:: classref-property
:ref:`float<class_float>` **secondary_positive_damp_threshold** :ref:`🔗<class_LookAtModifier3D_property_secondary_positive_damp_threshold>`
.. rst-class:: classref-property-setget
- |void| **set_secondary_positive_damp_threshold**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_secondary_positive_damp_threshold**\ (\ )
开始对 :ref:`secondary_positive_limit_angle<class_LookAtModifier3D_property_secondary_positive_limit_angle>` 执行阻尼的阈值。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_secondary_positive_limit_angle:
.. rst-class:: classref-property
:ref:`float<class_float>` **secondary_positive_limit_angle** :ref:`🔗<class_LookAtModifier3D_property_secondary_positive_limit_angle>`
.. rst-class:: classref-property-setget
- |void| **set_secondary_positive_limit_angle**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_secondary_positive_limit_angle**\ (\ )
:ref:`symmetry_limitation<class_LookAtModifier3D_property_symmetry_limitation>```false`` 时,次旋转正方向的限制角度。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_symmetry_limitation:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **symmetry_limitation** :ref:`🔗<class_LookAtModifier3D_property_symmetry_limitation>`
.. rst-class:: classref-property-setget
- |void| **set_symmetry_limitation**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_limitation_symmetry**\ (\ )
如果 ``true``\ ,则限制对称地分布在骨骼两侧。
如果 ``false``\ ,则可以为骨骼放松时的每一侧单独指定限制。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_target_node:
.. rst-class:: classref-property
:ref:`NodePath<class_NodePath>` **target_node** = ``NodePath("")`` :ref:`🔗<class_LookAtModifier3D_property_target_node>`
.. rst-class:: classref-property-setget
- |void| **set_target_node**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
- :ref:`NodePath<class_NodePath>` **get_target_node**\ (\ )
朝向修改的目标节点的 :ref:`NodePath<class_NodePath>`\ 。该节点是修改时骨骼旋转的目标。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_transition_type:
.. rst-class:: classref-property
:ref:`TransitionType<enum_Tween_TransitionType>` **transition_type** = ``0`` :ref:`🔗<class_LookAtModifier3D_property_transition_type>`
.. rst-class:: classref-property-setget
- |void| **set_transition_type**\ (\ value\: :ref:`TransitionType<enum_Tween_TransitionType>`\ )
- :ref:`TransitionType<enum_Tween_TransitionType>` **get_transition_type**\ (\ )
基于时间的插值的过渡类型。另见 :ref:`TransitionType<enum_Tween_TransitionType>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_use_angle_limitation:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **use_angle_limitation** = ``false`` :ref:`🔗<class_LookAtModifier3D_property_use_angle_limitation>`
.. rst-class:: classref-property-setget
- |void| **set_use_angle_limitation**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_using_angle_limitation**\ (\ )
如果为 ``true`` 则会限制旋转的角度。有助于防止角色的脖子发生 360 度旋转。
\ **注意:**\ 与 :ref:`AnimationTree<class_AnimationTree>` 混合一样,插值时会优先考虑 :ref:`Skeleton3D.get_bone_rest()<class_Skeleton3D_method_get_bone_rest>`\ 。这意味着插值在某些情况下不会选择最短路径。
\ **注意:**\ 某些 :ref:`transition_type<class_LookAtModifier3D_property_transition_type>` 可能会超出限制(例如 `Back``Elastic``Spring`)。如果在超出限制时发生插值,结果可能不会遵循骨骼的放松姿势。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_property_use_secondary_rotation:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **use_secondary_rotation** = ``true`` :ref:`🔗<class_LookAtModifier3D_property_use_secondary_rotation>`
.. rst-class:: classref-property-setget
- |void| **set_use_secondary_rotation**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_using_secondary_rotation**\ (\ )
如果为 ``true`` 就能够使用两个转轴。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法说明
--------
.. _class_LookAtModifier3D_method_get_interpolation_remaining:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_interpolation_remaining**\ (\ ) |const| :ref:`🔗<class_LookAtModifier3D_method_get_interpolation_remaining>`
返回基于时间的插值的剩余秒数。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_method_is_interpolating:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_interpolating**\ (\ ) |const| :ref:`🔗<class_LookAtModifier3D_method_is_interpolating>`
返回是否正在执行基于时间的插值。如果为 ``true``\ ,则等价于 :ref:`get_interpolation_remaining()<class_LookAtModifier3D_method_get_interpolation_remaining>```0``\ 。
适用于确定是否能够安全移除 **LookAtModifier3D**\ 。
.. rst-class:: classref-item-separator
----
.. _class_LookAtModifier3D_method_is_target_within_limitation:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_target_within_limitation**\ (\ ) |const| :ref:`🔗<class_LookAtModifier3D_method_is_target_within_limitation>`
返回目标是否在角度限制范围内。适用于在目标超出角度限制范围后将 :ref:`target_node<class_LookAtModifier3D_property_target_node>` 清空。
\ **注意:**\ 该值在 :ref:`SkeletonModifier3D._process_modification()<class_SkeletonModifier3D_private_method__process_modification>` 之后更新。为了获取正确的值,我们建议使用 :ref:`SkeletonModifier3D.modification_processed<class_SkeletonModifier3D_signal_modification_processed>` 信号。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
.. |void| replace:: :abbr:`void (无返回值。)`