Files
godot-docs-l10n/classes/zh_Hant/class_openxripbinding.rst

232 lines
10 KiB
ReStructuredText

:github_url: hide
.. _class_OpenXRIPBinding:
OpenXRIPBinding
===============
**繼承:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
定義 :ref:`OpenXRAction<class_OpenXRAction>` 和 XR 輸入或輸出之間的綁定。
.. rst-class:: classref-introduction-group
說明
----
This binding resource binds an :ref:`OpenXRAction<class_OpenXRAction>` to an input or output. As most controllers have left hand and right versions that are handled by the same interaction profile we can specify multiple bindings. For instance an action "Fire" could be bound to both "/user/hand/left/input/trigger" and "/user/hand/right/input/trigger". This would require two binding entries.
.. rst-class:: classref-reftable-group
屬性
----
.. table::
:widths: auto
+---------------------------------------------------+----------------------------------------------------------------------------+--------+
| :ref:`OpenXRAction<class_OpenXRAction>` | :ref:`action<class_OpenXRIPBinding_property_action>` | |
+---------------------------------------------------+----------------------------------------------------------------------------+--------+
| :ref:`Array<class_Array>` | :ref:`binding_modifiers<class_OpenXRIPBinding_property_binding_modifiers>` | ``[]`` |
+---------------------------------------------------+----------------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`binding_path<class_OpenXRIPBinding_property_binding_path>` | ``""`` |
+---------------------------------------------------+----------------------------------------------------------------------------+--------+
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`paths<class_OpenXRIPBinding_property_paths>` | |
+---------------------------------------------------+----------------------------------------------------------------------------+--------+
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_path<class_OpenXRIPBinding_method_add_path>`\ (\ path\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`OpenXRActionBindingModifier<class_OpenXRActionBindingModifier>` | :ref:`get_binding_modifier<class_OpenXRIPBinding_method_get_binding_modifier>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_binding_modifier_count<class_OpenXRIPBinding_method_get_binding_modifier_count>`\ (\ ) |const| |
+-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_path_count<class_OpenXRIPBinding_method_get_path_count>`\ (\ ) |const| |
+-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_path<class_OpenXRIPBinding_method_has_path>`\ (\ path\: :ref:`String<class_String>`\ ) |const| |
+-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_path<class_OpenXRIPBinding_method_remove_path>`\ (\ path\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
屬性說明
--------
.. _class_OpenXRIPBinding_property_action:
.. rst-class:: classref-property
:ref:`OpenXRAction<class_OpenXRAction>` **action** :ref:`🔗<class_OpenXRIPBinding_property_action>`
.. rst-class:: classref-property-setget
- |void| **set_action**\ (\ value\: :ref:`OpenXRAction<class_OpenXRAction>`\ )
- :ref:`OpenXRAction<class_OpenXRAction>` **get_action**\ (\ )
:ref:`OpenXRAction<class_OpenXRAction>` that is bound to :ref:`binding_path<class_OpenXRIPBinding_property_binding_path>`.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRIPBinding_property_binding_modifiers:
.. rst-class:: classref-property
:ref:`Array<class_Array>` **binding_modifiers** = ``[]`` :ref:`🔗<class_OpenXRIPBinding_property_binding_modifiers>`
.. rst-class:: classref-property-setget
- |void| **set_binding_modifiers**\ (\ value\: :ref:`Array<class_Array>`\ )
- :ref:`Array<class_Array>` **get_binding_modifiers**\ (\ )
Binding modifiers for this binding.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRIPBinding_property_binding_path:
.. rst-class:: classref-property
:ref:`String<class_String>` **binding_path** = ``""`` :ref:`🔗<class_OpenXRIPBinding_property_binding_path>`
.. rst-class:: classref-property-setget
- |void| **set_binding_path**\ (\ value\: :ref:`String<class_String>`\ )
- :ref:`String<class_String>` **get_binding_path**\ (\ )
Binding path that defines the input or output bound to :ref:`action<class_OpenXRIPBinding_property_action>`.
\ **Note:** Binding paths are suggestions, an XR runtime may choose to bind the action to a different input or output emulating this input or output.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRIPBinding_property_paths:
.. rst-class:: classref-property
:ref:`PackedStringArray<class_PackedStringArray>` **paths** :ref:`🔗<class_OpenXRIPBinding_property_paths>`
.. rst-class:: classref-property-setget
- |void| **set_paths**\ (\ value\: :ref:`PackedStringArray<class_PackedStringArray>`\ )
- :ref:`PackedStringArray<class_PackedStringArray>` **get_paths**\ (\ )
**已棄用:** Use :ref:`binding_path<class_OpenXRIPBinding_property_binding_path>` instead.
定義該裝置上綁定的輸入或輸出的路徑。
**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedStringArray<class_PackedStringArray>` for more details.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法說明
--------
.. _class_OpenXRIPBinding_method_add_path:
.. rst-class:: classref-method
|void| **add_path**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_OpenXRIPBinding_method_add_path>`
**已棄用:** Binding is for a single path.
為該綁定新增輸入/輸出路徑。
.. rst-class:: classref-item-separator
----
.. _class_OpenXRIPBinding_method_get_binding_modifier:
.. rst-class:: classref-method
:ref:`OpenXRActionBindingModifier<class_OpenXRActionBindingModifier>` **get_binding_modifier**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_OpenXRIPBinding_method_get_binding_modifier>`
Get the :ref:`OpenXRBindingModifier<class_OpenXRBindingModifier>` at this index.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRIPBinding_method_get_binding_modifier_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_binding_modifier_count**\ (\ ) |const| :ref:`🔗<class_OpenXRIPBinding_method_get_binding_modifier_count>`
Get the number of binding modifiers for this binding.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRIPBinding_method_get_path_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_path_count**\ (\ ) |const| :ref:`🔗<class_OpenXRIPBinding_method_get_path_count>`
**已棄用:** Binding is for a single path.
獲取該綁定中輸入/輸出路徑的數量。
.. rst-class:: classref-item-separator
----
.. _class_OpenXRIPBinding_method_has_path:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_path**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_OpenXRIPBinding_method_has_path>`
**已棄用:** Binding is for a single path.
如果該輸入/輸出路徑是該綁定的一部分,則返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_OpenXRIPBinding_method_remove_path:
.. rst-class:: classref-method
|void| **remove_path**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_OpenXRIPBinding_method_remove_path>`
**已棄用:** Binding is for a single path.
從該綁定中移除該輸入/輸出路徑。
.. |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 (無回傳值。)`