mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
461 lines
18 KiB
ReStructuredText
461 lines
18 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_SkeletonModifier3D:
|
|
|
|
SkeletonModifier3D
|
|
==================
|
|
|
|
**繼承:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**被繼承:** :ref:`BoneConstraint3D<class_BoneConstraint3D>`, :ref:`BoneTwistDisperser3D<class_BoneTwistDisperser3D>`, :ref:`IKModifier3D<class_IKModifier3D>`, :ref:`LimitAngularVelocityModifier3D<class_LimitAngularVelocityModifier3D>`, :ref:`LookAtModifier3D<class_LookAtModifier3D>`, :ref:`ModifierBoneTarget3D<class_ModifierBoneTarget3D>`, :ref:`PhysicalBoneSimulator3D<class_PhysicalBoneSimulator3D>`, :ref:`RetargetModifier3D<class_RetargetModifier3D>`, :ref:`SkeletonIK3D<class_SkeletonIK3D>`, :ref:`SpringBoneSimulator3D<class_SpringBoneSimulator3D>`, :ref:`XRBodyModifier3D<class_XRBodyModifier3D>`, :ref:`XRHandModifier3D<class_XRHandModifier3D>`
|
|
|
|
A node that may modify a Skeleton3D's bones.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
說明
|
|
----
|
|
|
|
**SkeletonModifier3D** retrieves a target :ref:`Skeleton3D<class_Skeleton3D>` by having a :ref:`Skeleton3D<class_Skeleton3D>` parent.
|
|
|
|
If there is an :ref:`AnimationMixer<class_AnimationMixer>`, a modification always performs after playback process of the :ref:`AnimationMixer<class_AnimationMixer>`.
|
|
|
|
This node should be used to implement custom IK solvers, constraints, or skeleton physics.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
教學
|
|
----
|
|
|
|
- `Design of the Skeleton Modifier 3D <https://godotengine.org/article/design-of-the-skeleton-modifier-3d/>`__
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
屬性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------+---------------------------------------------------------------+----------+
|
|
| :ref:`bool<class_bool>` | :ref:`active<class_SkeletonModifier3D_property_active>` | ``true`` |
|
|
+---------------------------+---------------------------------------------------------------+----------+
|
|
| :ref:`float<class_float>` | :ref:`influence<class_SkeletonModifier3D_property_influence>` | ``1.0`` |
|
|
+---------------------------+---------------------------------------------------------------+----------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
方法
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`_process_modification<class_SkeletonModifier3D_private_method__process_modification>`\ (\ ) |virtual| |
|
|
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`_process_modification_with_delta<class_SkeletonModifier3D_private_method__process_modification_with_delta>`\ (\ delta\: :ref:`float<class_float>`\ ) |virtual| |
|
|
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`_skeleton_changed<class_SkeletonModifier3D_private_method__skeleton_changed>`\ (\ old_skeleton\: :ref:`Skeleton3D<class_Skeleton3D>`, new_skeleton\: :ref:`Skeleton3D<class_Skeleton3D>`\ ) |virtual| |
|
|
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`_validate_bone_names<class_SkeletonModifier3D_private_method__validate_bone_names>`\ (\ ) |virtual| |
|
|
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Skeleton3D<class_Skeleton3D>` | :ref:`get_skeleton<class_SkeletonModifier3D_method_get_skeleton>`\ (\ ) |const| |
|
|
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
訊號
|
|
----
|
|
|
|
.. _class_SkeletonModifier3D_signal_modification_processed:
|
|
|
|
.. rst-class:: classref-signal
|
|
|
|
**modification_processed**\ (\ ) :ref:`🔗<class_SkeletonModifier3D_signal_modification_processed>`
|
|
|
|
Notifies when the modification have been finished.
|
|
|
|
\ **Note:** If you want to get the modified bone pose by the modifier, you must use :ref:`Skeleton3D.get_bone_pose()<class_Skeleton3D_method_get_bone_pose>` or :ref:`Skeleton3D.get_bone_global_pose()<class_Skeleton3D_method_get_bone_global_pose>` at the moment this signal is fired.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
列舉
|
|
----
|
|
|
|
.. _enum_SkeletonModifier3D_BoneAxis:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **BoneAxis**: :ref:`🔗<enum_SkeletonModifier3D_BoneAxis>`
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_X:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_PLUS_X** = ``0``
|
|
|
|
Enumerated value for the +X axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_X:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_MINUS_X** = ``1``
|
|
|
|
Enumerated value for the -X axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_Y:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_PLUS_Y** = ``2``
|
|
|
|
Enumerated value for the +Y axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_Y:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_MINUS_Y** = ``3``
|
|
|
|
Enumerated value for the -Y axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_AXIS_PLUS_Z:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_PLUS_Z** = ``4``
|
|
|
|
Enumerated value for the +Z axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_AXIS_MINUS_Z:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneAxis<enum_SkeletonModifier3D_BoneAxis>` **BONE_AXIS_MINUS_Z** = ``5``
|
|
|
|
Enumerated value for the -Z axis.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _enum_SkeletonModifier3D_BoneDirection:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **BoneDirection**: :ref:`🔗<enum_SkeletonModifier3D_BoneDirection>`
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_DIRECTION_PLUS_X:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_PLUS_X** = ``0``
|
|
|
|
Enumerated value for the +X axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_DIRECTION_MINUS_X:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_MINUS_X** = ``1``
|
|
|
|
Enumerated value for the -X axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_DIRECTION_PLUS_Y:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_PLUS_Y** = ``2``
|
|
|
|
Enumerated value for the +Y axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_DIRECTION_MINUS_Y:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_MINUS_Y** = ``3``
|
|
|
|
Enumerated value for the -Y axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_DIRECTION_PLUS_Z:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_PLUS_Z** = ``4``
|
|
|
|
Enumerated value for the +Z axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_DIRECTION_MINUS_Z:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_MINUS_Z** = ``5``
|
|
|
|
Enumerated value for the -Z axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_BONE_DIRECTION_FROM_PARENT:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BoneDirection<enum_SkeletonModifier3D_BoneDirection>` **BONE_DIRECTION_FROM_PARENT** = ``6``
|
|
|
|
Enumerated value for the axis from a parent bone to the child bone.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _enum_SkeletonModifier3D_SecondaryDirection:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **SecondaryDirection**: :ref:`🔗<enum_SkeletonModifier3D_SecondaryDirection>`
|
|
|
|
.. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_NONE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_NONE** = ``0``
|
|
|
|
Enumerated value for the case when the axis is undefined.
|
|
|
|
.. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_PLUS_X:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_PLUS_X** = ``1``
|
|
|
|
Enumerated value for the +X axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_MINUS_X:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_MINUS_X** = ``2``
|
|
|
|
Enumerated value for the -X axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_PLUS_Y:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_PLUS_Y** = ``3``
|
|
|
|
Enumerated value for the +Y axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_MINUS_Y:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_MINUS_Y** = ``4``
|
|
|
|
Enumerated value for the -Y axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_PLUS_Z:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_PLUS_Z** = ``5``
|
|
|
|
Enumerated value for the +Z axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_MINUS_Z:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_MINUS_Z** = ``6``
|
|
|
|
Enumerated value for the -Z axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_SECONDARY_DIRECTION_CUSTOM:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`SecondaryDirection<enum_SkeletonModifier3D_SecondaryDirection>` **SECONDARY_DIRECTION_CUSTOM** = ``7``
|
|
|
|
Enumerated value for an optional axis.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _enum_SkeletonModifier3D_RotationAxis:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **RotationAxis**: :ref:`🔗<enum_SkeletonModifier3D_RotationAxis>`
|
|
|
|
.. _class_SkeletonModifier3D_constant_ROTATION_AXIS_X:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_X** = ``0``
|
|
|
|
Enumerated value for the rotation of the X axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_ROTATION_AXIS_Y:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_Y** = ``1``
|
|
|
|
Enumerated value for the rotation of the Y axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_ROTATION_AXIS_Z:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_Z** = ``2``
|
|
|
|
Enumerated value for the rotation of the Z axis.
|
|
|
|
.. _class_SkeletonModifier3D_constant_ROTATION_AXIS_ALL:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_ALL** = ``3``
|
|
|
|
Enumerated value for the unconstrained rotation.
|
|
|
|
.. _class_SkeletonModifier3D_constant_ROTATION_AXIS_CUSTOM:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`RotationAxis<enum_SkeletonModifier3D_RotationAxis>` **ROTATION_AXIS_CUSTOM** = ``4``
|
|
|
|
Enumerated value for an optional rotation axis.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
屬性說明
|
|
--------
|
|
|
|
.. _class_SkeletonModifier3D_property_active:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **active** = ``true`` :ref:`🔗<class_SkeletonModifier3D_property_active>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_active**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_active**\ (\ )
|
|
|
|
If ``true``, the **SkeletonModifier3D** will be processing.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModifier3D_property_influence:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **influence** = ``1.0`` :ref:`🔗<class_SkeletonModifier3D_property_influence>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_influence**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_influence**\ (\ )
|
|
|
|
Sets the influence of the modification.
|
|
|
|
\ **Note:** This value is used by :ref:`Skeleton3D<class_Skeleton3D>` to blend, so the **SkeletonModifier3D** should always apply only 100% of the result without interpolation.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
方法說明
|
|
--------
|
|
|
|
.. _class_SkeletonModifier3D_private_method__process_modification:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **_process_modification**\ (\ ) |virtual| :ref:`🔗<class_SkeletonModifier3D_private_method__process_modification>`
|
|
|
|
**已棄用:** Use :ref:`_process_modification_with_delta()<class_SkeletonModifier3D_private_method__process_modification_with_delta>` instead.
|
|
|
|
Override this virtual method to implement a custom skeleton modifier. You should do things like get the :ref:`Skeleton3D<class_Skeleton3D>`'s current pose and apply the pose here.
|
|
|
|
\ :ref:`_process_modification()<class_SkeletonModifier3D_private_method__process_modification>` must not apply :ref:`influence<class_SkeletonModifier3D_property_influence>` to bone poses because the :ref:`Skeleton3D<class_Skeleton3D>` automatically applies influence to all bone poses set by the modifier.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModifier3D_private_method__process_modification_with_delta:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **_process_modification_with_delta**\ (\ delta\: :ref:`float<class_float>`\ ) |virtual| :ref:`🔗<class_SkeletonModifier3D_private_method__process_modification_with_delta>`
|
|
|
|
Override this virtual method to implement a custom skeleton modifier. You should do things like get the :ref:`Skeleton3D<class_Skeleton3D>`'s current pose and apply the pose here.
|
|
|
|
\ :ref:`_process_modification_with_delta()<class_SkeletonModifier3D_private_method__process_modification_with_delta>` must not apply :ref:`influence<class_SkeletonModifier3D_property_influence>` to bone poses because the :ref:`Skeleton3D<class_Skeleton3D>` automatically applies influence to all bone poses set by the modifier.
|
|
|
|
\ ``delta`` is passed from parent :ref:`Skeleton3D<class_Skeleton3D>`. See also :ref:`Skeleton3D.advance()<class_Skeleton3D_method_advance>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModifier3D_private_method__skeleton_changed:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **_skeleton_changed**\ (\ old_skeleton\: :ref:`Skeleton3D<class_Skeleton3D>`, new_skeleton\: :ref:`Skeleton3D<class_Skeleton3D>`\ ) |virtual| :ref:`🔗<class_SkeletonModifier3D_private_method__skeleton_changed>`
|
|
|
|
Called when the skeleton is changed.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModifier3D_private_method__validate_bone_names:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **_validate_bone_names**\ (\ ) |virtual| :ref:`🔗<class_SkeletonModifier3D_private_method__validate_bone_names>`
|
|
|
|
Called when bone names and indices need to be validated, such as when entering the scene tree or changing skeleton.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModifier3D_method_get_skeleton:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Skeleton3D<class_Skeleton3D>` **get_skeleton**\ (\ ) |const| :ref:`🔗<class_SkeletonModifier3D_method_get_skeleton>`
|
|
|
|
Returns the parent :ref:`Skeleton3D<class_Skeleton3D>` node if it exists. Otherwise, returns ``null``.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |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 (無回傳值。)`
|