class_openxraction.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/modules/openxr/doc_classes/OpenXRAction.xml.
  6. .. _class_OpenXRAction:
  7. OpenXRAction
  8. ============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. An OpenXR action.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This resource defines an OpenXR action. Actions can be used both for inputs (buttons/joystick/trigger/etc) and outputs (haptics).
  15. 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.
  16. 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.
  17. Note that the name of the resource is used to register the action with.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +---------------------------------------------------+-------------------------------------------------------------------+-------------------------+
  24. | :ref:`ActionType<enum_OpenXRAction_ActionType>` | :ref:`action_type<class_OpenXRAction_property_action_type>` | ``1`` |
  25. +---------------------------------------------------+-------------------------------------------------------------------+-------------------------+
  26. | :ref:`String<class_String>` | :ref:`localized_name<class_OpenXRAction_property_localized_name>` | ``""`` |
  27. +---------------------------------------------------+-------------------------------------------------------------------+-------------------------+
  28. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`toplevel_paths<class_OpenXRAction_property_toplevel_paths>` | ``PackedStringArray()`` |
  29. +---------------------------------------------------+-------------------------------------------------------------------+-------------------------+
  30. .. rst-class:: classref-section-separator
  31. ----
  32. .. rst-class:: classref-descriptions-group
  33. Enumerations
  34. ------------
  35. .. _enum_OpenXRAction_ActionType:
  36. .. rst-class:: classref-enumeration
  37. enum **ActionType**:
  38. .. _class_OpenXRAction_constant_OPENXR_ACTION_BOOL:
  39. .. rst-class:: classref-enumeration-constant
  40. :ref:`ActionType<enum_OpenXRAction_ActionType>` **OPENXR_ACTION_BOOL** = ``0``
  41. This action provides a boolean value.
  42. .. _class_OpenXRAction_constant_OPENXR_ACTION_FLOAT:
  43. .. rst-class:: classref-enumeration-constant
  44. :ref:`ActionType<enum_OpenXRAction_ActionType>` **OPENXR_ACTION_FLOAT** = ``1``
  45. This action provides a float value between ``0.0`` and ``1.0`` for any analog input such as triggers.
  46. .. _class_OpenXRAction_constant_OPENXR_ACTION_VECTOR2:
  47. .. rst-class:: classref-enumeration-constant
  48. :ref:`ActionType<enum_OpenXRAction_ActionType>` **OPENXR_ACTION_VECTOR2** = ``2``
  49. This action provides a :ref:`Vector2<class_Vector2>` value and can be bound to embedded trackpads and joysticks.
  50. .. _class_OpenXRAction_constant_OPENXR_ACTION_POSE:
  51. .. rst-class:: classref-enumeration-constant
  52. :ref:`ActionType<enum_OpenXRAction_ActionType>` **OPENXR_ACTION_POSE** = ``3``
  53. .. rst-class:: classref-section-separator
  54. ----
  55. .. rst-class:: classref-descriptions-group
  56. Property Descriptions
  57. ---------------------
  58. .. _class_OpenXRAction_property_action_type:
  59. .. rst-class:: classref-property
  60. :ref:`ActionType<enum_OpenXRAction_ActionType>` **action_type** = ``1``
  61. .. rst-class:: classref-property-setget
  62. - void **set_action_type** **(** :ref:`ActionType<enum_OpenXRAction_ActionType>` value **)**
  63. - :ref:`ActionType<enum_OpenXRAction_ActionType>` **get_action_type** **(** **)**
  64. The type of action.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_OpenXRAction_property_localized_name:
  68. .. rst-class:: classref-property
  69. :ref:`String<class_String>` **localized_name** = ``""``
  70. .. rst-class:: classref-property-setget
  71. - void **set_localized_name** **(** :ref:`String<class_String>` value **)**
  72. - :ref:`String<class_String>` **get_localized_name** **(** **)**
  73. The localized description of this action.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_OpenXRAction_property_toplevel_paths:
  77. .. rst-class:: classref-property
  78. :ref:`PackedStringArray<class_PackedStringArray>` **toplevel_paths** = ``PackedStringArray()``
  79. .. rst-class:: classref-property-setget
  80. - void **set_toplevel_paths** **(** :ref:`PackedStringArray<class_PackedStringArray>` value **)**
  81. - :ref:`PackedStringArray<class_PackedStringArray>` **get_toplevel_paths** **(** **)**
  82. A collections of toplevel paths to which this action can be bound.
  83. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  84. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  85. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  86. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  87. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  88. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  89. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`