mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
791 lines
44 KiB
ReStructuredText
791 lines
44 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. DO NOT EDIT THIS FILE!!!
|
||
.. Generated automatically from Godot engine sources.
|
||
.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
|
||
.. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/Skeleton3D.xml.
|
||
|
||
.. _class_Skeleton3D:
|
||
|
||
Skeleton3D
|
||
==========
|
||
|
||
**继承:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
包含骨骼层级结构的节点,用于创建 3D 骨骼动画。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
描述
|
||
----
|
||
|
||
**Skeleton3D** 提供了管理骨骼层级结构的接口,包括姿势、放松姿势和动画(见 :ref:`Animation<class_Animation>`\ )。它还可以使用布娃娃物理。
|
||
|
||
骨骼相对于骨架的整体变换由骨骼的姿势决定。骨骼的放松姿势定义的是骨骼姿势的初始变换。
|
||
|
||
请注意,下文的“全局姿势”是指骨骼相对于骨架的整体变换,因此并不是骨骼的实际全局/世界变换。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
教程
|
||
----
|
||
|
||
- `3D 逆运动学演示 <https://godotengine.org/asset-library/asset/523>`__
|
||
|
||
- `第三人称射击演示 <https://godotengine.org/asset-library/asset/678>`__
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
属性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+---------------------------+---------------------------------------------------------------------------------+-----------+
|
||
| :ref:`bool<class_bool>` | :ref:`animate_physical_bones<class_Skeleton3D_property_animate_physical_bones>` | ``true`` |
|
||
+---------------------------+---------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`motion_scale<class_Skeleton3D_property_motion_scale>` | ``1.0`` |
|
||
+---------------------------+---------------------------------------------------------------------------------+-----------+
|
||
| :ref:`bool<class_bool>` | :ref:`show_rest_only<class_Skeleton3D_property_show_rest_only>` | ``false`` |
|
||
+---------------------------+---------------------------------------------------------------------------------+-----------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`add_bone<class_Skeleton3D_method_add_bone>` **(** :ref:`String<class_String>` name **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`clear_bones<class_Skeleton3D_method_clear_bones>` **(** **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`clear_bones_global_pose_override<class_Skeleton3D_method_clear_bones_global_pose_override>` **(** **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Skin<class_Skin>` | :ref:`create_skin_from_rest_transforms<class_Skeleton3D_method_create_skin_from_rest_transforms>` **(** **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`find_bone<class_Skeleton3D_method_find_bone>` **(** :ref:`String<class_String>` name **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`force_update_all_bone_transforms<class_Skeleton3D_method_force_update_all_bone_transforms>` **(** **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`force_update_bone_child_transform<class_Skeleton3D_method_force_update_bone_child_transform>` **(** :ref:`int<class_int>` bone_idx **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_bone_children<class_Skeleton3D_method_get_bone_children>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_bone_count<class_Skeleton3D_method_get_bone_count>` **(** **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_pose<class_Skeleton3D_method_get_bone_global_pose>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_pose_no_override<class_Skeleton3D_method_get_bone_global_pose_no_override>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_pose_override<class_Skeleton3D_method_get_bone_global_pose_override>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_global_rest<class_Skeleton3D_method_get_bone_global_rest>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_bone_name<class_Skeleton3D_method_get_bone_name>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_bone_parent<class_Skeleton3D_method_get_bone_parent>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_pose<class_Skeleton3D_method_get_bone_pose>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector3<class_Vector3>` | :ref:`get_bone_pose_position<class_Skeleton3D_method_get_bone_pose_position>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Quaternion<class_Quaternion>` | :ref:`get_bone_pose_rotation<class_Skeleton3D_method_get_bone_pose_rotation>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector3<class_Vector3>` | :ref:`get_bone_pose_scale<class_Skeleton3D_method_get_bone_pose_scale>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_bone_rest<class_Skeleton3D_method_get_bone_rest>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_parentless_bones<class_Skeleton3D_method_get_parentless_bones>` **(** **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_version<class_Skeleton3D_method_get_version>` **(** **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_bone_enabled<class_Skeleton3D_method_is_bone_enabled>` **(** :ref:`int<class_int>` bone_idx **)** |const| |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`localize_rests<class_Skeleton3D_method_localize_rests>` **(** **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`physical_bones_add_collision_exception<class_Skeleton3D_method_physical_bones_add_collision_exception>` **(** :ref:`RID<class_RID>` exception **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`physical_bones_remove_collision_exception<class_Skeleton3D_method_physical_bones_remove_collision_exception>` **(** :ref:`RID<class_RID>` exception **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`physical_bones_start_simulation<class_Skeleton3D_method_physical_bones_start_simulation>` **(** :ref:`StringName[]<class_StringName>` bones=[] **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`physical_bones_stop_simulation<class_Skeleton3D_method_physical_bones_stop_simulation>` **(** **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`SkinReference<class_SkinReference>` | :ref:`register_skin<class_Skeleton3D_method_register_skin>` **(** :ref:`Skin<class_Skin>` skin **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`reset_bone_pose<class_Skeleton3D_method_reset_bone_pose>` **(** :ref:`int<class_int>` bone_idx **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`reset_bone_poses<class_Skeleton3D_method_reset_bone_poses>` **(** **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`set_bone_enabled<class_Skeleton3D_method_set_bone_enabled>` **(** :ref:`int<class_int>` bone_idx, :ref:`bool<class_bool>` enabled=true **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`set_bone_global_pose_override<class_Skeleton3D_method_set_bone_global_pose_override>` **(** :ref:`int<class_int>` bone_idx, :ref:`Transform3D<class_Transform3D>` pose, :ref:`float<class_float>` amount, :ref:`bool<class_bool>` persistent=false **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`set_bone_name<class_Skeleton3D_method_set_bone_name>` **(** :ref:`int<class_int>` bone_idx, :ref:`String<class_String>` name **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`set_bone_parent<class_Skeleton3D_method_set_bone_parent>` **(** :ref:`int<class_int>` bone_idx, :ref:`int<class_int>` parent_idx **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`set_bone_pose_position<class_Skeleton3D_method_set_bone_pose_position>` **(** :ref:`int<class_int>` bone_idx, :ref:`Vector3<class_Vector3>` position **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`set_bone_pose_rotation<class_Skeleton3D_method_set_bone_pose_rotation>` **(** :ref:`int<class_int>` bone_idx, :ref:`Quaternion<class_Quaternion>` rotation **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`set_bone_pose_scale<class_Skeleton3D_method_set_bone_pose_scale>` **(** :ref:`int<class_int>` bone_idx, :ref:`Vector3<class_Vector3>` scale **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`set_bone_rest<class_Skeleton3D_method_set_bone_rest>` **(** :ref:`int<class_int>` bone_idx, :ref:`Transform3D<class_Transform3D>` rest **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| void | :ref:`unparent_bone_and_rest<class_Skeleton3D_method_unparent_bone_and_rest>` **(** :ref:`int<class_int>` bone_idx **)** |
|
||
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
信号
|
||
----
|
||
|
||
.. _class_Skeleton3D_signal_bone_enabled_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**bone_enabled_changed** **(** :ref:`int<class_int>` bone_idx **)**
|
||
|
||
当使用 :ref:`set_bone_enabled<class_Skeleton3D_method_set_bone_enabled>` 切换 ``bone_idx`` 处的骨骼时发出。使用 :ref:`is_bone_enabled<class_Skeleton3D_method_is_bone_enabled>` 来检查新值。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_signal_bone_pose_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**bone_pose_changed** **(** :ref:`int<class_int>` bone_idx **)**
|
||
|
||
当该 Skeleton3D 节点中的任一骨骼,改变了它们的姿势时,就会发出这个信号。这用于通知依赖骨骼位置的节点,Skeleton3D 中的任一骨骼已经改变了它们的变换/姿势。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_signal_pose_updated:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**pose_updated** **(** **)**
|
||
|
||
收到 :ref:`NOTIFICATION_UPDATE_SKELETON<class_Skeleton3D_constant_NOTIFICATION_UPDATE_SKELETON>` 后更新姿势时触发。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_signal_show_rest_only_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**show_rest_only_changed** **(** **)**
|
||
|
||
当 :ref:`show_rest_only<class_Skeleton3D_property_show_rest_only>` 的值改变时触发。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
常量
|
||
----
|
||
|
||
.. _class_Skeleton3D_constant_NOTIFICATION_UPDATE_SKELETON:
|
||
|
||
.. rst-class:: classref-constant
|
||
|
||
**NOTIFICATION_UPDATE_SKELETON** = ``50``
|
||
|
||
当该骨架的姿势需要更新时收到的通知。
|
||
|
||
该通知是在相关 :ref:`pose_updated<class_Skeleton3D_signal_pose_updated>` 信号\ *之前*\ 接收的。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
属性说明
|
||
--------
|
||
|
||
.. _class_Skeleton3D_property_animate_physical_bones:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **animate_physical_bones** = ``true``
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- void **set_animate_physical_bones** **(** :ref:`bool<class_bool>` value **)**
|
||
- :ref:`bool<class_bool>` **get_animate_physical_bones** **(** **)**
|
||
|
||
.. container:: contribute
|
||
|
||
目前没有这个属性的描述。请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ !
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_property_motion_scale:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **motion_scale** = ``1.0``
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- void **set_motion_scale** **(** :ref:`float<class_float>` value **)**
|
||
- :ref:`float<class_float>` **get_motion_scale** **(** **)**
|
||
|
||
与 3D 位置轨道动画相乘。
|
||
|
||
\ **注意:**\ 除非这个值是 ``1.0``\ ,否则动画中的键值将与实际位置值不匹配。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_property_show_rest_only:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **show_rest_only** = ``false``
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- void **set_show_rest_only** **(** :ref:`bool<class_bool>` value **)**
|
||
- :ref:`bool<class_bool>` **is_show_rest_only** **(** **)**
|
||
|
||
如果为 ``true``\ ,则无论其值如何,强制骨骼处于默认放松姿势。在编辑器中,这也会阻止骨骼被编辑。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法说明
|
||
--------
|
||
|
||
.. _class_Skeleton3D_method_add_bone:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **add_bone** **(** :ref:`String<class_String>` name **)**
|
||
|
||
添加骨骼,名称为 ``name``\ 。\ :ref:`get_bone_count<class_Skeleton3D_method_get_bone_count>` 将成为该骨骼的索引。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_clear_bones:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **clear_bones** **(** **)**
|
||
|
||
清除这个骨架上的所有骨骼。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_clear_bones_global_pose_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **clear_bones_global_pose_override** **(** **)**
|
||
|
||
移除骨架中所有骨骼上的全局姿势覆盖。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_create_skin_from_rest_transforms:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Skin<class_Skin>` **create_skin_from_rest_transforms** **(** **)**
|
||
|
||
.. container:: contribute
|
||
|
||
目前没有这个方法的描述。请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ !
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_find_bone:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **find_bone** **(** :ref:`String<class_String>` name **)** |const|
|
||
|
||
返回名称与 ``name`` 匹配的骨骼的索引。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_force_update_all_bone_transforms:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **force_update_all_bone_transforms** **(** **)**
|
||
|
||
强制更新该骨架中所有骨骼的变换/姿势。
|
||
|
||
\ *已废弃。*\ 请勿使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_force_update_bone_child_transform:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **force_update_bone_child_transform** **(** :ref:`int<class_int>` bone_idx **)**
|
||
|
||
强制更新索引为 ``bone_idx`` 的骨骼及其所有子项的变换/姿势。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_children:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedInt32Array<class_PackedInt32Array>` **get_bone_children** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回一个数组,其中包含传入骨骼 ``bone_idx`` 的所有子节点的骨骼索引。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_bone_count** **(** **)** |const|
|
||
|
||
返回骨架中骨骼的数量。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_global_pose:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Transform3D<class_Transform3D>` **get_bone_global_pose** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回指定骨骼的整体变换,相对于骨架。由于是相对于骨架的,这不是该骨骼的实际“全局”变换。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_global_pose_no_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Transform3D<class_Transform3D>` **get_bone_global_pose_no_override** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回指定骨骼的整体变换,相对于骨架,不包含任何全局姿势覆盖。由于是相对于骨架的,这不是该骨骼的实际“全局”变换。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_global_pose_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Transform3D<class_Transform3D>` **get_bone_global_pose_override** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回 ``bone_idx`` 骨骼的全局姿势覆盖变换。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_global_rest:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Transform3D<class_Transform3D>` **get_bone_global_rest** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回 ``bone_idx`` 骨骼的全局放松变换。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_name:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_bone_name** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回索引为 ``bone_idx`` 的骨骼的名称。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_parent:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_bone_parent** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回 ``bone_idx`` 处的骨骼的父级骨骼索引。如果为 -1,则该骨骼没有父级。
|
||
|
||
\ **注意:**\ 返回的父骨骼索引总是小于 ``bone_idx``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_pose:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Transform3D<class_Transform3D>` **get_bone_pose** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回指定骨骼的姿势变换。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_pose_position:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector3<class_Vector3>` **get_bone_pose_position** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回骨骼在 ``bone_idx``\ 处的姿势位置。返回的 :ref:`Vector3<class_Vector3>` 位于 **Skeleton3D** 节点的局部坐标空间中。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_pose_rotation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Quaternion<class_Quaternion>` **get_bone_pose_rotation** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回 ``bone_idx`` 处骨骼的姿势旋转。返回的 :ref:`Quaternion<class_Quaternion>` 是局部于该骨骼的,且相对于任何父骨骼的旋转。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_pose_scale:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector3<class_Vector3>` **get_bone_pose_scale** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回 ``bone_idx`` 处骨骼的姿态缩放。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_bone_rest:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Transform3D<class_Transform3D>` **get_bone_rest** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回骨骼 ``bone_idx`` 的放松变换。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_parentless_bones:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedInt32Array<class_PackedInt32Array>` **get_parentless_bones** **(** **)** |const|
|
||
|
||
返回一个包含所有无父级的骨骼的数组。另一种看待这一点的方法是,它返回所有骨骼的索引,这些骨骼不依赖于该骨架中的其他骨骼,或不被该骨架中的其他骨骼修改。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_get_version:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_version** **(** **)** |const|
|
||
|
||
返回骨骼层次结构在该骨架中更改的次数,包括重命名。
|
||
|
||
骨架版本没有被序列化:只能在 Skeleton3D 的单个实例中使用。
|
||
|
||
用于使 IK 解算器中的和处理骨骼的其他节点中的缓存失效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_is_bone_enabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_bone_enabled** **(** :ref:`int<class_int>` bone_idx **)** |const|
|
||
|
||
返回位于 ``bone_idx`` 的骨骼是否启用了骨骼姿势。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_localize_rests:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **localize_rests** **(** **)**
|
||
|
||
将骨架中的所有骨骼都恢复到放松姿势。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_physical_bones_add_collision_exception:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **physical_bones_add_collision_exception** **(** :ref:`RID<class_RID>` exception **)**
|
||
|
||
向物理骨骼添加一个碰撞例外。
|
||
|
||
就像 :ref:`RigidBody3D<class_RigidBody3D>` 节点一样工作。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_physical_bones_remove_collision_exception:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **physical_bones_remove_collision_exception** **(** :ref:`RID<class_RID>` exception **)**
|
||
|
||
移除物理骨骼的一个碰撞例外。
|
||
|
||
就像 :ref:`RigidBody3D<class_RigidBody3D>` 节点一样工作。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_physical_bones_start_simulation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **physical_bones_start_simulation** **(** :ref:`StringName[]<class_StringName>` bones=[] **)**
|
||
|
||
让 Skeleton 中的 :ref:`PhysicalBone3D<class_PhysicalBone3D>` 节点开始仿真模拟,对物理世界做出反应。
|
||
|
||
可以传入骨骼名称列表,只对传入的骨骼进行仿真模拟。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_physical_bones_stop_simulation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **physical_bones_stop_simulation** **(** **)**
|
||
|
||
让 Skeleton 中的 :ref:`PhysicalBone3D<class_PhysicalBone3D>` 节点停止仿真模拟。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_register_skin:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`SkinReference<class_SkinReference>` **register_skin** **(** :ref:`Skin<class_Skin>` skin **)**
|
||
|
||
将给定的 Skin 绑定到 Skeleton。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_reset_bone_pose:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **reset_bone_pose** **(** :ref:`int<class_int>` bone_idx **)**
|
||
|
||
将 ``bone_idx`` 骨骼设置为放松姿势。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_reset_bone_poses:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **reset_bone_poses** **(** **)**
|
||
|
||
将所有骨骼都设置为放松姿势。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_set_bone_enabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **set_bone_enabled** **(** :ref:`int<class_int>` bone_idx, :ref:`bool<class_bool>` enabled=true **)**
|
||
|
||
如果为 ``false`` 则为位于 ``bone_idx`` 的骨骼禁用姿势,如果为 ``true`` 则启用该骨骼姿势。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_set_bone_global_pose_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **set_bone_global_pose_override** **(** :ref:`int<class_int>` bone_idx, :ref:`Transform3D<class_Transform3D>` pose, :ref:`float<class_float>` amount, :ref:`bool<class_bool>` persistent=false **)**
|
||
|
||
为 ``bone_idx`` 处的骨骼设置全局姿势变换 ``pose``\ 。
|
||
|
||
\ ``amount`` 是应用姿势时将使用的插值强度,\ ``persistent`` 决定应用的姿势是否会保留。
|
||
|
||
\ **注意:**\ 姿势变换需要的是全局姿势!要将 :ref:`Node3D<class_Node3D>` 的世界变换转换为全局骨骼姿势,请将节点的 :ref:`Node3D.global_transform<class_Node3D_property_global_transform>` 的 :ref:`Transform3D.affine_inverse<class_Transform3D_method_affine_inverse>` 乘以所期望的世界变换。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_set_bone_name:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **set_bone_name** **(** :ref:`int<class_int>` bone_idx, :ref:`String<class_String>` name **)**
|
||
|
||
.. container:: contribute
|
||
|
||
目前没有这个方法的描述。请帮我们\ :ref:`贡献一个 <doc_updating_the_class_reference>`\ !
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_set_bone_parent:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **set_bone_parent** **(** :ref:`int<class_int>` bone_idx, :ref:`int<class_int>` parent_idx **)**
|
||
|
||
将骨骼索引 ``parent_idx`` 设置为 ``bone_idx`` 处骨骼的父级。如果为 -1,则该骨骼没有父级。
|
||
|
||
\ **注意:**\ ``parent_idx`` 必须小于 ``bone_idx``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_set_bone_pose_position:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **set_bone_pose_position** **(** :ref:`int<class_int>` bone_idx, :ref:`Vector3<class_Vector3>` position **)**
|
||
|
||
将 ``bone_idx`` 处的骨骼姿势位置设置为 ``position``\ 。\ ``position`` 是一个 :ref:`Vector3<class_Vector3>`\ ,描述局部于 **Skeleton3D** 节点的位置。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_set_bone_pose_rotation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **set_bone_pose_rotation** **(** :ref:`int<class_int>` bone_idx, :ref:`Quaternion<class_Quaternion>` rotation **)**
|
||
|
||
将 ``bone_idx`` 处骨骼的姿势旋转设置为 ``rotation``\ 。\ ``rotation`` 是一个 :ref:`Quaternion<class_Quaternion>`\ ,描述该骨骼局部坐标空间中相对于任何父骨骼的旋转的旋转。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_set_bone_pose_scale:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **set_bone_pose_scale** **(** :ref:`int<class_int>` bone_idx, :ref:`Vector3<class_Vector3>` scale **)**
|
||
|
||
将 ``bone_idx`` 处骨骼的姿势缩放设置为 ``scale``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_set_bone_rest:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **set_bone_rest** **(** :ref:`int<class_int>` bone_idx, :ref:`Transform3D<class_Transform3D>` rest **)**
|
||
|
||
设置骨骼 ``bone_idx`` 的放松变换。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Skeleton3D_method_unparent_bone_and_rest:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
void **unparent_bone_and_rest** **(** :ref:`int<class_int>` bone_idx **)**
|
||
|
||
让位于 ``bone_idx`` 的骨骼不再有父级,并将其放松位置设置为之前父级放松时的位置。
|
||
|
||
.. |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 (这个值是由下列标志构成的位掩码整数。)`
|