123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- :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/modules/openxr/doc_classes/OpenXRAction.xml.
- .. _class_OpenXRAction:
- OpenXRAction
- ============
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- An OpenXR action.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- This resource defines an OpenXR action. Actions can be used both for inputs (buttons/joystick/trigger/etc) and outputs (haptics).
- OpenXR performs automatic conversion between action type and input type whenever possible. An analog trigger bound to a boolean action will thus return ``false`` if the trigger is depressed and ``true`` if pressed fully.
- Actions are not directly bound to specific devices, instead OpenXR recognizes a limited number of top level paths that identify devices by usage. We can restrict which devices an action can be bound to by these top level paths. For instance an action that should only be used for hand held controllers can have the top level paths "/user/hand/left" and "/user/hand/right" associated with them. See the `reserved path section in the OpenXR specification <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-reserved>`__ for more info on the top level paths.
- Note that the name of the resource is used to register the action with.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +---------------------------------------------------+-------------------------------------------------------------------+-------------------------+
- | :ref:`ActionType<enum_OpenXRAction_ActionType>` | :ref:`action_type<class_OpenXRAction_property_action_type>` | ``1`` |
- +---------------------------------------------------+-------------------------------------------------------------------+-------------------------+
- | :ref:`String<class_String>` | :ref:`localized_name<class_OpenXRAction_property_localized_name>` | ``""`` |
- +---------------------------------------------------+-------------------------------------------------------------------+-------------------------+
- | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`toplevel_paths<class_OpenXRAction_property_toplevel_paths>` | ``PackedStringArray()`` |
- +---------------------------------------------------+-------------------------------------------------------------------+-------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_OpenXRAction_ActionType:
- .. rst-class:: classref-enumeration
- enum **ActionType**:
- .. _class_OpenXRAction_constant_OPENXR_ACTION_BOOL:
- .. rst-class:: classref-enumeration-constant
- :ref:`ActionType<enum_OpenXRAction_ActionType>` **OPENXR_ACTION_BOOL** = ``0``
- This action provides a boolean value.
- .. _class_OpenXRAction_constant_OPENXR_ACTION_FLOAT:
- .. rst-class:: classref-enumeration-constant
- :ref:`ActionType<enum_OpenXRAction_ActionType>` **OPENXR_ACTION_FLOAT** = ``1``
- This action provides a float value between ``0.0`` and ``1.0`` for any analog input such as triggers.
- .. _class_OpenXRAction_constant_OPENXR_ACTION_VECTOR2:
- .. rst-class:: classref-enumeration-constant
- :ref:`ActionType<enum_OpenXRAction_ActionType>` **OPENXR_ACTION_VECTOR2** = ``2``
- This action provides a :ref:`Vector2<class_Vector2>` value and can be bound to embedded trackpads and joysticks.
- .. _class_OpenXRAction_constant_OPENXR_ACTION_POSE:
- .. rst-class:: classref-enumeration-constant
- :ref:`ActionType<enum_OpenXRAction_ActionType>` **OPENXR_ACTION_POSE** = ``3``
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_OpenXRAction_property_action_type:
- .. rst-class:: classref-property
- :ref:`ActionType<enum_OpenXRAction_ActionType>` **action_type** = ``1``
- .. rst-class:: classref-property-setget
- - void **set_action_type** **(** :ref:`ActionType<enum_OpenXRAction_ActionType>` value **)**
- - :ref:`ActionType<enum_OpenXRAction_ActionType>` **get_action_type** **(** **)**
- The type of action.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRAction_property_localized_name:
- .. rst-class:: classref-property
- :ref:`String<class_String>` **localized_name** = ``""``
- .. rst-class:: classref-property-setget
- - void **set_localized_name** **(** :ref:`String<class_String>` value **)**
- - :ref:`String<class_String>` **get_localized_name** **(** **)**
- The localized description of this action.
- .. rst-class:: classref-item-separator
- ----
- .. _class_OpenXRAction_property_toplevel_paths:
- .. rst-class:: classref-property
- :ref:`PackedStringArray<class_PackedStringArray>` **toplevel_paths** = ``PackedStringArray()``
- .. rst-class:: classref-property-setget
- - void **set_toplevel_paths** **(** :ref:`PackedStringArray<class_PackedStringArray>` value **)**
- - :ref:`PackedStringArray<class_PackedStringArray>` **get_toplevel_paths** **(** **)**
- A collections of toplevel paths to which this action can be bound.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|