summaryrefslogtreecommitdiff
path: root/modules/openxr/doc_classes
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2021-12-14 12:44:12 +1100
committerRĂ©mi Verschelde <rverschelde@gmail.com>2022-02-23 12:02:24 +0100
commita78a9fee7194297fca8867b4983deb4da0ba18c2 (patch)
tree342d988883aa6779b8c2014c3723dfcbf97116fa /modules/openxr/doc_classes
parent65bae5a3411a6fd2dbfc9f8e364040024fa81b04 (diff)
Implementing OpenXR driver
Diffstat (limited to 'modules/openxr/doc_classes')
-rw-r--r--modules/openxr/doc_classes/OpenXRAction.xml38
-rw-r--r--modules/openxr/doc_classes/OpenXRActionMap.xml55
-rw-r--r--modules/openxr/doc_classes/OpenXRActionSet.xml40
-rw-r--r--modules/openxr/doc_classes/OpenXRIPBinding.xml19
-rw-r--r--modules/openxr/doc_classes/OpenXRInteractionProfile.xml20
-rw-r--r--modules/openxr/doc_classes/OpenXRInterface.xml13
6 files changed, 185 insertions, 0 deletions
diff --git a/modules/openxr/doc_classes/OpenXRAction.xml b/modules/openxr/doc_classes/OpenXRAction.xml
new file mode 100644
index 0000000000..6ff8c1ad26
--- /dev/null
+++ b/modules/openxr/doc_classes/OpenXRAction.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="OpenXRAction" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
+ <brief_description>
+ An OpenXR action.
+ </brief_description>
+ <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 analogue trigger bound to a boolean action will thus return [code]false[/core] if the trigger is depressed and [code]true[/code] if pressed fully.
+ Actions are not directly bound to specific devices, instead OpenXR recognises 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 [url=https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-reserved]reserved path section in the OpenXR specification[/url] for more info on the top level paths.
+ Note that the name of the resource is used to register the action with.
+ </description>
+ <tutorials>
+ </tutorials>
+ <members>
+ <member name="action_type" type="int" setter="set_action_type" getter="get_action_type" enum="OpenXRAction.ActionType" default="1">
+ The type of action.
+ </member>
+ <member name="localized_name" type="String" setter="set_localized_name" getter="get_localized_name" default="&quot;&quot;">
+ The localised description of this action.
+ </member>
+ <member name="toplevel_paths" type="PackedStringArray" setter="set_toplevel_paths" getter="get_toplevel_paths" default="PackedStringArray()">
+ A collections of toplevel paths to which this action can be bound.
+ </member>
+ </members>
+ <constants>
+ <constant name="OPENXR_ACTION_BOOL" value="0" enum="ActionType">
+ This action provides a boolean value.
+ </constant>
+ <constant name="OPENXR_ACTION_FLOAT" value="1" enum="ActionType">
+ This action provides a float value between [code]0.0[/code] and [code]1.0[/code] for any analogue input such as triggers.
+ </constant>
+ <constant name="OPENXR_ACTION_VECTOR2" value="2" enum="ActionType">
+ This action provides a vector2 value and can be bound to embedded trackpads and joysticks
+ </constant>
+ <constant name="OPENXR_ACTION_POSE" value="3" enum="ActionType">
+ </constant>
+ </constants>
+</class>
diff --git a/modules/openxr/doc_classes/OpenXRActionMap.xml b/modules/openxr/doc_classes/OpenXRActionMap.xml
new file mode 100644
index 0000000000..f1def8aad8
--- /dev/null
+++ b/modules/openxr/doc_classes/OpenXRActionMap.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="OpenXRActionMap" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
+ <brief_description>
+ Collection of [OpenXRActionSet] and [OpenXRInteractionProfile] resources for the OpenXR module.
+ </brief_description>
+ <description>
+ OpenXR uses an action system similar to Godots Input map system to bind inputs and outputs on various types of XR controllers to named actions. OpenXR specifies more detail on these inputs and outputs than Godot supports.
+ Another important distinction is that OpenXR offers no control over these bindings. The bindings we register are suggestions, it is up to the XR runtime to offer users the ability to change these bindings. This allows the XR runtime to fill in the gaps if new hardware becomes available.
+ The action map therefor needs to be loaded at startup and can't be changed afterwards. This resource is a container for the entire action map.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_action_set">
+ <return type="void" />
+ <argument index="0" name="action_set" type="OpenXRActionSet" />
+ <description>
+ Add an action set.
+ </description>
+ </method>
+ <method name="add_interaction_profile">
+ <return type="void" />
+ <argument index="0" name="interaction_profile" type="OpenXRInteractionProfile" />
+ <description>
+ Add an interaction profile.
+ </description>
+ </method>
+ <method name="create_default_action_sets">
+ <return type="void" />
+ <description>
+ Setup this action set with our default actions.
+ </description>
+ </method>
+ <method name="remove_action_set">
+ <return type="void" />
+ <argument index="0" name="action_set" type="OpenXRActionSet" />
+ <description>
+ Remove an action set.
+ </description>
+ </method>
+ <method name="remove_interaction_profile">
+ <return type="void" />
+ <argument index="0" name="interaction_profile" type="OpenXRInteractionProfile" />
+ <description>
+ Remove an interaction profile.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="action_sets" type="Array" setter="set_action_sets" getter="get_action_sets" default="[]">
+ </member>
+ <member name="interaction_profiles" type="Array" setter="set_interaction_profiles" getter="get_interaction_profiles" default="[]">
+ </member>
+ </members>
+</class>
diff --git a/modules/openxr/doc_classes/OpenXRActionSet.xml b/modules/openxr/doc_classes/OpenXRActionSet.xml
new file mode 100644
index 0000000000..5a87de463e
--- /dev/null
+++ b/modules/openxr/doc_classes/OpenXRActionSet.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="OpenXRActionSet" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
+ <brief_description>
+ Collection of [OpenXRAction] resources that make up an action set.
+ </brief_description>
+ <description>
+ Action sets in OpenXR define a collection of actions that can be activated in unison. This allows games to easily change between different states that require different inputs or need to reinterpret inputs. For instance we could have an action set that is active when a menu is open, an action set that is active when the player is freely walking around and an action set that is active when the player is controlling a vehicle.
+ Action sets can contain the same actions, or actions with the same name, if such action sets are active at the same time the action set with the highest priority defines which binding is active.
+ Note that the name of the resource is used to identify the action set within OpenXR.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="add_action">
+ <return type="void" />
+ <argument index="0" name="action" type="OpenXRAction" />
+ <description>
+ Add an action to this action set.
+ </description>
+ </method>
+ <method name="remove_action">
+ <return type="void" />
+ <argument index="0" name="action" type="OpenXRAction" />
+ <description>
+ Remove an action from this action set.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="actions" type="Array" setter="set_actions" getter="get_actions" default="[]">
+ Collection of actions for this action set.
+ </member>
+ <member name="localized_name" type="String" setter="set_localized_name" getter="get_localized_name" default="&quot;&quot;">
+ The localised name of this action set.
+ </member>
+ <member name="priority" type="int" setter="set_priority" getter="get_priority" default="0">
+ The priority for this action set.
+ </member>
+ </members>
+</class>
diff --git a/modules/openxr/doc_classes/OpenXRIPBinding.xml b/modules/openxr/doc_classes/OpenXRIPBinding.xml
new file mode 100644
index 0000000000..3fdcde5eb5
--- /dev/null
+++ b/modules/openxr/doc_classes/OpenXRIPBinding.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="OpenXRIPBinding" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
+ <brief_description>
+ Defines a binding between an [OpenXRAction] and an XR input or output.
+ </brief_description>
+ <description>
+ This binding resource binds an OpenXR action to inputs or outputs. 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".
+ </description>
+ <tutorials>
+ </tutorials>
+ <members>
+ <member name="action" type="OpenXRAction" setter="set_action" getter="get_action">
+ Action that is bound to these paths.
+ </member>
+ <member name="paths" type="PackedStringArray" setter="set_paths" getter="get_paths" default="PackedStringArray()">
+ Paths that define the inputs or outputs bound on the device.
+ </member>
+ </members>
+</class>
diff --git a/modules/openxr/doc_classes/OpenXRInteractionProfile.xml b/modules/openxr/doc_classes/OpenXRInteractionProfile.xml
new file mode 100644
index 0000000000..a8629caae4
--- /dev/null
+++ b/modules/openxr/doc_classes/OpenXRInteractionProfile.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="OpenXRInteractionProfile" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
+ <brief_description>
+ Suggested bindings object for OpenXR.
+ </brief_description>
+ <description>
+ This object stores suggested bindings for an interaction profile. Interaction profiles define the meta data for a tracked XR device such as an XR controller.
+ For more information see the [url=https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles]interaction profiles info in the OpenXR specification[/url].
+ </description>
+ <tutorials>
+ </tutorials>
+ <members>
+ <member name="bindings" type="Array" setter="set_bindings" getter="get_bindings" default="[]">
+ Action bindings for this interaction profile.
+ </member>
+ <member name="interaction_profile_path" type="String" setter="set_interaction_profile_path" getter="get_interaction_profile_path" default="&quot;&quot;">
+ The interaction profile path identifying the XR device.
+ </member>
+ </members>
+</class>
diff --git a/modules/openxr/doc_classes/OpenXRInterface.xml b/modules/openxr/doc_classes/OpenXRInterface.xml
new file mode 100644
index 0000000000..1160061e04
--- /dev/null
+++ b/modules/openxr/doc_classes/OpenXRInterface.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="OpenXRInterface" inherits="XRInterface" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
+ <brief_description>
+ Our OpenXR interface.
+ </brief_description>
+ <description>
+ The OpenXR interface allows Godot to interact with OpenXR runtimes and make it possible to create XR experiences and games.
+ Due to the needs of OpenXR this interface works slightly different then other plugin based XR interfaces. It needs to be initialised when Godot starts. You need to enable OpenXR, settings for this can be found in your games project settings under the XR heading. You do need to mark a viewport for use with XR in order for Godot to know which render result should be output to the headset.
+ </description>
+ <tutorials>
+ <link title="OpenXR documentation">$DOCS_URL/tutorials/vr/openxr/index.html</link>
+ </tutorials>
+</class>