From a78a9fee7194297fca8867b4983deb4da0ba18c2 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Tue, 14 Dec 2021 12:44:12 +1100 Subject: Implementing OpenXR driver --- modules/openxr/doc_classes/OpenXRAction.xml | 38 +++++++++++++++ modules/openxr/doc_classes/OpenXRActionMap.xml | 55 ++++++++++++++++++++++ modules/openxr/doc_classes/OpenXRActionSet.xml | 40 ++++++++++++++++ modules/openxr/doc_classes/OpenXRIPBinding.xml | 19 ++++++++ .../doc_classes/OpenXRInteractionProfile.xml | 20 ++++++++ modules/openxr/doc_classes/OpenXRInterface.xml | 13 +++++ 6 files changed, 185 insertions(+) create mode 100644 modules/openxr/doc_classes/OpenXRAction.xml create mode 100644 modules/openxr/doc_classes/OpenXRActionMap.xml create mode 100644 modules/openxr/doc_classes/OpenXRActionSet.xml create mode 100644 modules/openxr/doc_classes/OpenXRIPBinding.xml create mode 100644 modules/openxr/doc_classes/OpenXRInteractionProfile.xml create mode 100644 modules/openxr/doc_classes/OpenXRInterface.xml (limited to 'modules/openxr/doc_classes') 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 @@ + + + + An OpenXR action. + + + 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. + + + + + + The type of action. + + + The localised description of this action. + + + A collections of toplevel paths to which this action can be bound. + + + + + This action provides a boolean value. + + + This action provides a float value between [code]0.0[/code] and [code]1.0[/code] for any analogue input such as triggers. + + + This action provides a vector2 value and can be bound to embedded trackpads and joysticks + + + + + 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 @@ + + + + Collection of [OpenXRActionSet] and [OpenXRInteractionProfile] resources for the OpenXR module. + + + 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. + + + + + + + + + Add an action set. + + + + + + + Add an interaction profile. + + + + + + Setup this action set with our default actions. + + + + + + + Remove an action set. + + + + + + + Remove an interaction profile. + + + + + + + + + + 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 @@ + + + + Collection of [OpenXRAction] resources that make up an action set. + + + 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. + + + + + + + + + Add an action to this action set. + + + + + + + Remove an action from this action set. + + + + + + Collection of actions for this action set. + + + The localised name of this action set. + + + The priority for this action set. + + + 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 @@ + + + + Defines a binding between an [OpenXRAction] and an XR input or output. + + + 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". + + + + + + Action that is bound to these paths. + + + Paths that define the inputs or outputs bound on the device. + + + 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 @@ + + + + Suggested bindings object for OpenXR. + + + 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]. + + + + + + Action bindings for this interaction profile. + + + The interaction profile path identifying the XR device. + + + 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 @@ + + + + Our OpenXR interface. + + + 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. + + + $DOCS_URL/tutorials/vr/openxr/index.html + + -- cgit v1.2.3