initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled

This commit is contained in:
2025-09-16 20:46:46 -04:00
commit 9d30169a8d
13378 changed files with 7050105 additions and 0 deletions

View File

@@ -0,0 +1,347 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRAPIExtension" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Makes the OpenXR API available for GDExtension.
</brief_description>
<description>
[OpenXRAPIExtension] makes OpenXR available for GDExtension. It provides the OpenXR API to GDExtension through the [method get_instance_proc_addr] method, and the OpenXR instance through [method get_instance].
It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with GDExtension.
</description>
<tutorials>
<link title="XrResult documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html</link>
<link title="XrInstance documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html</link>
<link title="XrSpace documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html</link>
<link title="XrSession documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html</link>
<link title="XrSystemId documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html</link>
<link title="xrBeginSession documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html</link>
<link title="XrPosef documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html</link>
</tutorials>
<methods>
<method name="action_get_handle">
<return type="int" />
<param index="0" name="action" type="RID" />
<description>
Returns the corresponding [code]XrAction[/code] OpenXR handle for the given action RID.
</description>
</method>
<method name="begin_debug_label_region">
<return type="void" />
<param index="0" name="label_name" type="String" />
<description>
Begins a new debug label region, this label will be reported in debug messages for any calls following this until [method end_debug_label_region] is called. Debug labels can be stacked.
</description>
</method>
<method name="can_render">
<return type="bool" />
<description>
Returns [code]true[/code] if OpenXR is initialized for rendering with an XR viewport.
</description>
</method>
<method name="end_debug_label_region">
<return type="void" />
<description>
Marks the end of a debug label region. Removes the latest debug label region added by calling [method begin_debug_label_region].
</description>
</method>
<method name="find_action">
<return type="RID" />
<param index="0" name="name" type="String" />
<param index="1" name="action_set" type="RID" />
<description>
Returns the [RID] corresponding to an [code]Action[/code] of a matching name, optionally limited to a specified action set.
</description>
</method>
<method name="get_error_string">
<return type="String" />
<param index="0" name="result" type="int" />
<description>
Returns an error string for the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url].
</description>
</method>
<method name="get_hand_tracker">
<return type="int" />
<param index="0" name="hand_index" type="int" />
<description>
Returns the corresponding [code]XRHandTrackerEXT[/code] handle for the given hand index value.
</description>
</method>
<method name="get_instance">
<return type="int" />
<description>
Returns the [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html]XrInstance[/url] created during the initialization of the OpenXR API.
</description>
</method>
<method name="get_instance_proc_addr">
<return type="int" />
<param index="0" name="name" type="String" />
<description>
Returns the function pointer of the OpenXR function with the specified name, cast to an integer. If the function with the given name does not exist, the method returns [code]0[/code].
[b]Note:[/b] [code]openxr/util.h[/code] contains utility macros for acquiring OpenXR functions, e.g. [code]GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)[/code].
</description>
</method>
<method name="get_next_frame_time">
<return type="int" />
<description>
Returns the predicted display timing for the next frame.
</description>
</method>
<method name="get_play_space">
<return type="int" />
<description>
Returns the play space, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html]XrSpace[/url] cast to an integer.
</description>
</method>
<method name="get_predicted_display_time">
<return type="int" />
<description>
Returns the predicted display timing for the current frame.
</description>
</method>
<method name="get_projection_layer">
<return type="int" />
<description>
Returns a pointer to the render state's [code]XrCompositionLayerProjection[/code] struct.
[b]Note:[/b] This method should only be called from the rendering thread.
</description>
</method>
<method name="get_render_state_z_far">
<return type="float" />
<description>
Returns the far boundary value of the camera frustum.
[b]Note:[/b] This is only accessible in the render thread.
</description>
</method>
<method name="get_render_state_z_near">
<return type="float" />
<description>
Returns the near boundary value of the camera frustum.
[b]Note:[/b] This is only accessible in the render thread.
</description>
</method>
<method name="get_session">
<return type="int" />
<description>
Returns the OpenXR session, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html]XrSession[/url] cast to an integer.
</description>
</method>
<method name="get_supported_swapchain_formats">
<return type="PackedInt64Array" />
<description>
Returns an array of supported swapchain formats.
</description>
</method>
<method name="get_swapchain_format_name">
<return type="String" />
<param index="0" name="swapchain_format" type="int" />
<description>
Returns the name of the specified swapchain format.
</description>
</method>
<method name="get_system_id">
<return type="int" />
<description>
Returns the id of the system, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html]XrSystemId[/url] cast to an integer.
</description>
</method>
<method name="insert_debug_label">
<return type="void" />
<param index="0" name="label_name" type="String" />
<description>
Inserts a debug label, this label is reported in any debug message resulting from the OpenXR calls that follows, until any of [method begin_debug_label_region], [method end_debug_label_region], or [method insert_debug_label] is called.
</description>
</method>
<method name="is_environment_blend_mode_alpha_supported">
<return type="int" enum="OpenXRAPIExtension.OpenXRAlphaBlendModeSupport" />
<description>
Returns [enum OpenXRAPIExtension.OpenXRAlphaBlendModeSupport] denoting if [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported, emulated or not supported at all.
</description>
</method>
<method name="is_initialized">
<return type="bool" />
<description>
Returns [code]true[/code] if OpenXR is initialized.
</description>
</method>
<method name="is_running">
<return type="bool" />
<description>
Returns [code]true[/code] if OpenXR is running ([url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html]xrBeginSession[/url] was successfully called and the swapchains were created).
</description>
</method>
<method name="openxr_is_enabled" qualifiers="static">
<return type="bool" />
<param index="0" name="check_run_in_editor" type="bool" />
<description>
Returns [code]true[/code] if OpenXR is enabled.
</description>
</method>
<method name="openxr_swapchain_acquire">
<return type="void" />
<param index="0" name="swapchain" type="int" />
<description>
Acquires the image of the provided swapchain.
</description>
</method>
<method name="openxr_swapchain_create">
<return type="int" />
<param index="0" name="create_flags" type="int" />
<param index="1" name="usage_flags" type="int" />
<param index="2" name="swapchain_format" type="int" />
<param index="3" name="width" type="int" />
<param index="4" name="height" type="int" />
<param index="5" name="sample_count" type="int" />
<param index="6" name="array_size" type="int" />
<description>
Returns a pointer to a new swapchain created using the provided parameters.
</description>
</method>
<method name="openxr_swapchain_free">
<return type="void" />
<param index="0" name="swapchain" type="int" />
<description>
Destroys the provided swapchain and frees it from memory.
</description>
</method>
<method name="openxr_swapchain_get_image">
<return type="RID" />
<param index="0" name="swapchain" type="int" />
<description>
Returns the RID of the provided swapchain's image.
</description>
</method>
<method name="openxr_swapchain_get_swapchain">
<return type="int" />
<param index="0" name="swapchain" type="int" />
<description>
Returns the [code]XrSwapchain[/code] handle of the provided swapchain.
</description>
</method>
<method name="openxr_swapchain_release">
<return type="void" />
<param index="0" name="swapchain" type="int" />
<description>
Releases the image of the provided swapchain.
</description>
</method>
<method name="register_composition_layer_provider">
<return type="void" />
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
<description>
Registers the given extension as a composition layer provider.
</description>
</method>
<method name="register_frame_info_extension">
<return type="void" />
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
<description>
Registers the given extension as modifying frame info via the [method OpenXRExtensionWrapper._set_frame_wait_info_and_get_next_pointer], [method OpenXRExtensionWrapper._set_view_locate_info_and_get_next_pointer], or [method OpenXRExtensionWrapper._set_frame_end_info_and_get_next_pointer] virtual methods.
</description>
</method>
<method name="register_projection_views_extension">
<return type="void" />
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
<description>
Registers the given extension as a provider of additional data structures to projections views.
</description>
</method>
<method name="set_custom_play_space">
<return type="void" />
<param index="0" name="space" type="const void*" />
<description>
Sets the reference space used by OpenXR to the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html]XrSpace[/url] (cast to a [code]void *[/code]).
</description>
</method>
<method name="set_emulate_environment_blend_mode_alpha_blend">
<return type="void" />
<param index="0" name="enabled" type="bool" />
<description>
If set to [code]true[/code], an OpenXR extension is loaded which is capable of emulating the [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] blend mode.
</description>
</method>
<method name="set_object_name">
<return type="void" />
<param index="0" name="object_type" type="int" />
<param index="1" name="object_handle" type="int" />
<param index="2" name="object_name" type="String" />
<description>
Set the object name of an OpenXR object, used for debug output. [param object_type] must be a valid OpenXR [code]XrObjectType[/code] enum and [param object_handle] must be a valid OpenXR object handle.
</description>
</method>
<method name="set_render_region">
<return type="void" />
<param index="0" name="render_region" type="Rect2i" />
<description>
Sets the render region to [param render_region], overriding the normal render target's rect.
</description>
</method>
<method name="set_velocity_depth_texture">
<return type="void" />
<param index="0" name="render_target" type="RID" />
<description>
Sets the render target of the velocity depth texture.
</description>
</method>
<method name="set_velocity_target_size">
<return type="void" />
<param index="0" name="target_size" type="Vector2i" />
<description>
Sets the target size of the velocity and velocity depth textures.
</description>
</method>
<method name="set_velocity_texture">
<return type="void" />
<param index="0" name="render_target" type="RID" />
<description>
Sets the render target of the velocity texture.
</description>
</method>
<method name="transform_from_pose">
<return type="Transform3D" />
<param index="0" name="pose" type="const void*" />
<description>
Creates a [Transform3D] from an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html]XrPosef[/url].
</description>
</method>
<method name="unregister_composition_layer_provider">
<return type="void" />
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
<description>
Unregisters the given extension as a composition layer provider.
</description>
</method>
<method name="unregister_frame_info_extension">
<return type="void" />
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
<description>
Unregisters the given extension as modifying frame info.
</description>
</method>
<method name="unregister_projection_views_extension">
<return type="void" />
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
<description>
Unregisters the given extension as a provider of additional data structures to projections views.
</description>
</method>
<method name="xr_result">
<return type="bool" />
<param index="0" name="result" type="int" />
<param index="1" name="format" type="String" />
<param index="2" name="args" type="Array" />
<description>
Returns [code]true[/code] if the provided [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] (cast to an integer) is successful. Otherwise returns [code]false[/code] and prints the [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] converted to a string, with the specified additional information.
</description>
</method>
</methods>
<constants>
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE" value="0" enum="OpenXRAlphaBlendModeSupport">
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] isn't supported at all.
</constant>
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL" value="1" enum="OpenXRAlphaBlendModeSupport">
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported.
</constant>
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING" value="2" enum="OpenXRAlphaBlendModeSupport">
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is emulated.
</constant>
</constants>
</class>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRAction" inherits="Resource" 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, joysticks, triggers, 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 [code]false[/code] if the trigger is depressed and [code]true[/code] 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 [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 localized 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 analog 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>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRActionBindingModifier" inherits="OpenXRBindingModifier" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Binding modifier that applies on individual actions related to an interaction profile.
</brief_description>
<description>
Binding modifier that applies on individual actions related to an interaction profile.
</description>
<tutorials>
</tutorials>
</class>

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRActionMap" inherits="Resource" 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 therefore 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" />
<param index="0" name="action_set" type="OpenXRActionSet" />
<description>
Add an action set.
</description>
</method>
<method name="add_interaction_profile">
<return type="void" />
<param 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="find_action_set" qualifiers="const">
<return type="OpenXRActionSet" />
<param index="0" name="name" type="String" />
<description>
Retrieve an action set by name.
</description>
</method>
<method name="find_interaction_profile" qualifiers="const">
<return type="OpenXRInteractionProfile" />
<param index="0" name="name" type="String" />
<description>
Find an interaction profile by its name (path).
</description>
</method>
<method name="get_action_set" qualifiers="const">
<return type="OpenXRActionSet" />
<param index="0" name="idx" type="int" />
<description>
Retrieve the action set at this index.
</description>
</method>
<method name="get_action_set_count" qualifiers="const">
<return type="int" />
<description>
Retrieve the number of actions sets in our action map.
</description>
</method>
<method name="get_interaction_profile" qualifiers="const">
<return type="OpenXRInteractionProfile" />
<param index="0" name="idx" type="int" />
<description>
Get the interaction profile at this index.
</description>
</method>
<method name="get_interaction_profile_count" qualifiers="const">
<return type="int" />
<description>
Retrieve the number of interaction profiles in our action map.
</description>
</method>
<method name="remove_action_set">
<return type="void" />
<param index="0" name="action_set" type="OpenXRActionSet" />
<description>
Remove an action set.
</description>
</method>
<method name="remove_interaction_profile">
<return type="void" />
<param 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="[]">
Collection of [OpenXRActionSet]s that are part of this action map.
</member>
<member name="interaction_profiles" type="Array" setter="set_interaction_profiles" getter="get_interaction_profiles" default="[]">
Collection of [OpenXRInteractionProfile]s that are part of this action map.
</member>
</members>
</class>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRActionSet" inherits="Resource" 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 action 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.
</description>
<tutorials>
</tutorials>
<methods>
<method name="add_action">
<return type="void" />
<param index="0" name="action" type="OpenXRAction" />
<description>
Add an action to this action set.
</description>
</method>
<method name="get_action_count" qualifiers="const">
<return type="int" />
<description>
Retrieve the number of actions in our action set.
</description>
</method>
<method name="remove_action">
<return type="void" />
<param 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 localized 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>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRAnalogThresholdModifier" inherits="OpenXRActionBindingModifier" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
The analog threshold binding modifier can modify a float input to a boolean input with specified thresholds.
</brief_description>
<description>
The analog threshold binding modifier can modify a float input to a boolean input with specified thresholds.
See [url=https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XR_VALVE_analog_threshold]XR_VALVE_analog_threshold[/url] for in-depth details.
</description>
<tutorials>
</tutorials>
<members>
<member name="off_haptic" type="OpenXRHapticBase" setter="set_off_haptic" getter="get_off_haptic">
Haptic pulse to emit when the user releases the input.
</member>
<member name="off_threshold" type="float" setter="set_off_threshold" getter="get_off_threshold" default="0.4">
When our input value falls below this, our output becomes [code]false[/code].
</member>
<member name="on_haptic" type="OpenXRHapticBase" setter="set_on_haptic" getter="get_on_haptic">
Haptic pulse to emit when the user presses the input.
</member>
<member name="on_threshold" type="float" setter="set_on_threshold" getter="get_on_threshold" default="0.6">
When our input value is equal or larger than this value, our output becomes [code]true[/code]. It stays [code]true[/code] until it falls under the [member off_threshold] value.
</member>
</members>
</class>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRBindingModifier" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Binding modifier base class.
</brief_description>
<description>
Binding modifier base class. Subclasses implement various modifiers that alter how an OpenXR runtime processes inputs.
</description>
<tutorials>
</tutorials>
<methods>
<method name="_get_description" qualifiers="virtual required const">
<return type="String" />
<description>
Return the description of this class that is used for the title bar of the binding modifier editor.
</description>
</method>
<method name="_get_ip_modification" qualifiers="virtual required">
<return type="PackedByteArray" />
<description>
Returns the data that is sent to OpenXR when submitting the suggested interacting bindings this modifier is a part of.
[b]Note:[/b] This must be data compatible with an [code]XrBindingModificationBaseHeaderKHR[/code] structure.
</description>
</method>
</methods>
</class>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRBindingModifierEditor" inherits="PanelContainer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Binding modifier editor.
</brief_description>
<description>
This is the default binding modifier editor used in the OpenXR action map.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_binding_modifier" qualifiers="const">
<return type="OpenXRBindingModifier" />
<description>
Returns the [OpenXRBindingModifier] currently being edited.
</description>
</method>
<method name="setup">
<return type="void" />
<param index="0" name="action_map" type="OpenXRActionMap" />
<param index="1" name="binding_modifier" type="OpenXRBindingModifier" />
<description>
Setup this editor for the provided [param action_map] and [param binding_modifier].
</description>
</method>
</methods>
<members>
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="3" />
</members>
<signals>
<signal name="binding_modifier_removed">
<param index="0" name="binding_modifier_editor" type="Object" />
<description>
Signal emitted when the user presses the delete binding modifier button for this modifier.
</description>
</signal>
</signals>
</class>

View File

@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRCompositionLayer" inherits="Node3D" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
The parent class of all OpenXR composition layer nodes.
</brief_description>
<description>
Composition layers allow 2D viewports to be displayed inside of the headset by the XR compositor through special projections that retain their quality. This allows for rendering clear text while keeping the layer at a native resolution.
[b]Note:[/b] If the OpenXR runtime doesn't support the given composition layer type, a fallback mesh can be generated with a [ViewportTexture], in order to emulate the composition layer.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_android_surface">
<return type="JavaObject" />
<description>
Returns a [JavaObject] representing an [code]android.view.Surface[/code] if [member use_android_surface] is enabled and OpenXR has created the surface. Otherwise, this will return [code]null[/code].
[b]Note:[/b] The surface can only be created during an active OpenXR session. So, if [member use_android_surface] is enabled outside of an OpenXR session, it won't be created until a new session fully starts.
</description>
</method>
<method name="intersects_ray" qualifiers="const">
<return type="Vector2" />
<param index="0" name="origin" type="Vector3" />
<param index="1" name="direction" type="Vector3" />
<description>
Returns UV coordinates where the given ray intersects with the composition layer. [param origin] and [param direction] must be in global space.
Returns [code]Vector2(-1.0, -1.0)[/code] if the ray doesn't intersect.
</description>
</method>
<method name="is_natively_supported" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the OpenXR runtime natively supports this composition layer type.
[b]Note:[/b] This will only return an accurate result after the OpenXR session has started.
</description>
</method>
</methods>
<members>
<member name="alpha_blend" type="bool" setter="set_alpha_blend" getter="get_alpha_blend" default="false">
Enables the blending the layer using its alpha channel.
Can be combined with [member Viewport.transparent_bg] to give the layer a transparent background.
</member>
<member name="android_surface_size" type="Vector2i" setter="set_android_surface_size" getter="get_android_surface_size" default="Vector2i(1024, 1024)">
The size of the Android surface to create if [member use_android_surface] is enabled.
</member>
<member name="enable_hole_punch" type="bool" setter="set_enable_hole_punch" getter="get_enable_hole_punch" default="false">
Enables a technique called "hole punching", which allows putting the composition layer behind the main projection layer (i.e. setting [member sort_order] to a negative value) while "punching a hole" through everything rendered by Godot so that the layer is still visible.
This can be used to create the illusion that the composition layer exists in the same 3D space as everything rendered by Godot, allowing objects to appear to pass both behind or in front of the composition layer.
</member>
<member name="layer_viewport" type="SubViewport" setter="set_layer_viewport" getter="get_layer_viewport">
The [SubViewport] to render on the composition layer.
</member>
<member name="sort_order" type="int" setter="set_sort_order" getter="get_sort_order" default="1">
The sort order for this composition layer. Higher numbers will be shown in front of lower numbers.
[b]Note:[/b] This will have no effect if a fallback mesh is being used.
</member>
<member name="swapchain_state_alpha_swizzle" type="int" setter="set_alpha_swizzle" getter="get_alpha_swizzle" enum="OpenXRCompositionLayer.Swizzle" default="3">
The swizzle value for the alpha channel of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_blue_swizzle" type="int" setter="set_blue_swizzle" getter="get_blue_swizzle" enum="OpenXRCompositionLayer.Swizzle" default="2">
The swizzle value for the blue channel of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_border_color" type="Color" setter="set_border_color" getter="get_border_color" default="Color(0, 0, 0, 0)">
The border color of the swapchain state that is used when the wrap mode clamps to the border.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_green_swizzle" type="int" setter="set_green_swizzle" getter="get_green_swizzle" enum="OpenXRCompositionLayer.Swizzle" default="1">
The swizzle value for the green channel of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_horizontal_wrap" type="int" setter="set_horizontal_wrap" getter="get_horizontal_wrap" enum="OpenXRCompositionLayer.Wrap" default="0">
The horizontal wrap mode of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_mag_filter" type="int" setter="set_mag_filter" getter="get_mag_filter" enum="OpenXRCompositionLayer.Filter" default="1">
The magnification filter of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_max_anisotropy" type="float" setter="set_max_anisotropy" getter="get_max_anisotropy" default="1.0">
The max anisotropy of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_min_filter" type="int" setter="set_min_filter" getter="get_min_filter" enum="OpenXRCompositionLayer.Filter" default="1">
The minification filter of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_mipmap_mode" type="int" setter="set_mipmap_mode" getter="get_mipmap_mode" enum="OpenXRCompositionLayer.MipmapMode" default="2">
The mipmap mode of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_red_swizzle" type="int" setter="set_red_swizzle" getter="get_red_swizzle" enum="OpenXRCompositionLayer.Swizzle" default="0">
The swizzle value for the red channel of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="swapchain_state_vertical_wrap" type="int" setter="set_vertical_wrap" getter="get_vertical_wrap" enum="OpenXRCompositionLayer.Wrap" default="0">
The vertical wrap mode of the swapchain state.
[b]Note:[/b] This property only has an effect on devices that support the OpenXR XR_FB_swapchain_update_state OpenGLES/Vulkan extensions.
</member>
<member name="use_android_surface" type="bool" setter="set_use_android_surface" getter="get_use_android_surface" default="false">
If enabled, an Android surface will be created (with the dimensions from [member android_surface_size]) which will provide the 2D content for the composition layer, rather than using [member layer_viewport].
See [method get_android_surface] for information about how to get the surface so that your application can draw to it.
[b]Note:[/b] This will only work in Android builds.
</member>
</members>
<constants>
<constant name="FILTER_NEAREST" value="0" enum="Filter">
Perform nearest-neighbor filtering when sampling the texture.
</constant>
<constant name="FILTER_LINEAR" value="1" enum="Filter">
Perform linear filtering when sampling the texture.
</constant>
<constant name="FILTER_CUBIC" value="2" enum="Filter">
Perform cubic filtering when sampling the texture.
</constant>
<constant name="MIPMAP_MODE_DISABLED" value="0" enum="MipmapMode">
Disable mipmapping.
[b]Note:[/b] Mipmapping can only be disabled in the Compatibility renderer.
</constant>
<constant name="MIPMAP_MODE_NEAREST" value="1" enum="MipmapMode">
Use the mipmap of the nearest resolution.
</constant>
<constant name="MIPMAP_MODE_LINEAR" value="2" enum="MipmapMode">
Use linear interpolation of the two mipmaps of the nearest resolution.
</constant>
<constant name="WRAP_CLAMP_TO_BORDER" value="0" enum="Wrap">
Clamp the texture to its specified border color.
</constant>
<constant name="WRAP_CLAMP_TO_EDGE" value="1" enum="Wrap">
Clamp the texture to its edge color.
</constant>
<constant name="WRAP_REPEAT" value="2" enum="Wrap">
Repeat the texture infinitely.
</constant>
<constant name="WRAP_MIRRORED_REPEAT" value="3" enum="Wrap">
Repeat the texture infinitely, mirroring it on each repeat.
</constant>
<constant name="WRAP_MIRROR_CLAMP_TO_EDGE" value="4" enum="Wrap">
Mirror the texture once and then clamp the texture to its edge color.
[b]Note:[/b] This wrap mode is not available in the Compatibility renderer.
</constant>
<constant name="SWIZZLE_RED" value="0" enum="Swizzle">
Maps a color channel to the value of the red channel.
</constant>
<constant name="SWIZZLE_GREEN" value="1" enum="Swizzle">
Maps a color channel to the value of the green channel.
</constant>
<constant name="SWIZZLE_BLUE" value="2" enum="Swizzle">
Maps a color channel to the value of the blue channel.
</constant>
<constant name="SWIZZLE_ALPHA" value="3" enum="Swizzle">
Maps a color channel to the value of the alpha channel.
</constant>
<constant name="SWIZZLE_ZERO" value="4" enum="Swizzle">
Maps a color channel to the value of zero.
</constant>
<constant name="SWIZZLE_ONE" value="5" enum="Swizzle">
Maps a color channel to the value of one.
</constant>
</constants>
</class>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRCompositionLayerCylinder" inherits="OpenXRCompositionLayer" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
An OpenXR composition layer that is rendered as an internal slice of a cylinder.
</brief_description>
<description>
An OpenXR composition layer that allows rendering a [SubViewport] on an internal slice of a cylinder.
</description>
<tutorials>
</tutorials>
<members>
<member name="aspect_ratio" type="float" setter="set_aspect_ratio" getter="get_aspect_ratio" default="1.0">
The aspect ratio of the slice. Used to set the height relative to the width.
</member>
<member name="central_angle" type="float" setter="set_central_angle" getter="get_central_angle" default="1.5707964">
The central angle of the cylinder. Used to set the width.
</member>
<member name="fallback_segments" type="int" setter="set_fallback_segments" getter="get_fallback_segments" default="10">
The number of segments to use in the fallback mesh.
</member>
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
The radius of the cylinder.
</member>
</members>
</class>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRCompositionLayerEquirect" inherits="OpenXRCompositionLayer" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
An OpenXR composition layer that is rendered as an internal slice of a sphere.
</brief_description>
<description>
An OpenXR composition layer that allows rendering a [SubViewport] on an internal slice of a sphere.
</description>
<tutorials>
</tutorials>
<members>
<member name="central_horizontal_angle" type="float" setter="set_central_horizontal_angle" getter="get_central_horizontal_angle" default="1.5707964">
The central horizontal angle of the sphere. Used to set the width.
</member>
<member name="fallback_segments" type="int" setter="set_fallback_segments" getter="get_fallback_segments" default="10">
The number of segments to use in the fallback mesh.
</member>
<member name="lower_vertical_angle" type="float" setter="set_lower_vertical_angle" getter="get_lower_vertical_angle" default="0.7853982">
The lower vertical angle of the sphere. Used (together with [member upper_vertical_angle]) to set the height.
</member>
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
The radius of the sphere.
</member>
<member name="upper_vertical_angle" type="float" setter="set_upper_vertical_angle" getter="get_upper_vertical_angle" default="0.7853982">
The upper vertical angle of the sphere. Used (together with [member lower_vertical_angle]) to set the height.
</member>
</members>
</class>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRCompositionLayerQuad" inherits="OpenXRCompositionLayer" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
An OpenXR composition layer that is rendered as a quad.
</brief_description>
<description>
An OpenXR composition layer that allows rendering a [SubViewport] on a quad.
</description>
<tutorials>
</tutorials>
<members>
<member name="quad_size" type="Vector2" setter="set_quad_size" getter="get_quad_size" default="Vector2(1, 1)">
The dimensions of the quad.
</member>
</members>
</class>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRDpadBindingModifier" inherits="OpenXRIPBindingModifier" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
The DPad binding modifier converts an axis input to a dpad output.
</brief_description>
<description>
The DPad binding modifier converts an axis input to a dpad output, emulating a DPad. New input paths for each dpad direction will be added to the interaction profile. When bound to actions the DPad emulation will be activated. You should [b]not[/b] combine dpad inputs with normal inputs in the same action set for the same control, this will result in an error being returned when suggested bindings are submitted to OpenXR.
See [url=https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XR_EXT_dpad_binding]XR_EXT_dpad_binding[/url] for in-depth details.
[b]Note:[/b] If the DPad binding modifier extension is enabled, all dpad binding paths will be available in the action map. Adding the modifier to an interaction profile allows you to further customize the behavior.
</description>
<tutorials>
</tutorials>
<members>
<member name="action_set" type="OpenXRActionSet" setter="set_action_set" getter="get_action_set">
Action set for which this dpad binding modifier is active.
</member>
<member name="center_region" type="float" setter="set_center_region" getter="get_center_region" default="0.1">
Center region in which our center position of our dpad return [code]true[/code].
</member>
<member name="input_path" type="String" setter="set_input_path" getter="get_input_path" default="&quot;&quot;">
Input path for this dpad binding modifier.
</member>
<member name="is_sticky" type="bool" setter="set_is_sticky" getter="get_is_sticky" default="false">
If [code]false[/code], when the joystick enters a new dpad zone this becomes [code]true[/code].
If [code]true[/code], when the joystick remains in active dpad zone, this remains [code]true[/code] even if we overlap with another zone.
</member>
<member name="off_haptic" type="OpenXRHapticBase" setter="set_off_haptic" getter="get_off_haptic">
Haptic pulse to emit when the user releases the input.
</member>
<member name="on_haptic" type="OpenXRHapticBase" setter="set_on_haptic" getter="get_on_haptic">
Haptic pulse to emit when the user presses the input.
</member>
<member name="threshold" type="float" setter="set_threshold" getter="get_threshold" default="0.6">
When our input value is equal or larger than this value, our dpad in that direction becomes [code]true[/code]. It stays [code]true[/code] until it falls under the [member threshold_released] value.
</member>
<member name="threshold_released" type="float" setter="set_threshold_released" getter="get_threshold_released" default="0.4">
When our input value falls below this, our output becomes [code]false[/code].
</member>
<member name="wedge_angle" type="float" setter="set_wedge_angle" getter="get_wedge_angle" default="1.5707964">
The angle of each wedge that identifies the 4 directions of the emulated dpad.
</member>
</members>
</class>

View File

@@ -0,0 +1,311 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRExtensionWrapper" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Allows implementing OpenXR extensions with GDExtension.
</brief_description>
<description>
[OpenXRExtensionWrapper] allows implementing OpenXR extensions with GDExtension. The extension should be registered with [method register_extension_wrapper].
</description>
<tutorials>
</tutorials>
<methods>
<method name="_get_composition_layer" qualifiers="virtual">
<return type="int" />
<param index="0" name="index" type="int" />
<description>
Returns a pointer to an [code]XrCompositionLayerBaseHeader[/code] struct to provide the given composition layer.
This will only be called if the extension previously registered itself with [method OpenXRAPIExtension.register_composition_layer_provider].
</description>
</method>
<method name="_get_composition_layer_count" qualifiers="virtual">
<return type="int" />
<description>
Returns the number of composition layers this extension wrapper provides via [method _get_composition_layer].
This will only be called if the extension previously registered itself with [method OpenXRAPIExtension.register_composition_layer_provider].
</description>
</method>
<method name="_get_composition_layer_order" qualifiers="virtual">
<return type="int" />
<param index="0" name="index" type="int" />
<description>
Returns an integer that will be used to sort the given composition layer provided via [method _get_composition_layer]. Lower numbers will move the layer to the front of the list, and higher numbers to the end. The default projection layer has an order of [code]0[/code], so layers provided by this method should probably be above or below (but not exactly) [code]0[/code].
This will only be called if the extension previously registered itself with [method OpenXRAPIExtension.register_composition_layer_provider].
</description>
</method>
<method name="_get_requested_extensions" qualifiers="virtual">
<return type="Dictionary" />
<description>
Returns a [Dictionary] of OpenXR extensions related to this extension. The [Dictionary] should contain the name of the extension, mapped to a [code]bool *[/code] cast to an integer:
- If the [code]bool *[/code] is a [code]nullptr[/code] this extension is mandatory.
- If the [code]bool *[/code] points to a boolean, the boolean will be updated to [code]true[/code] if the extension is enabled.
</description>
</method>
<method name="_get_suggested_tracker_names" qualifiers="virtual">
<return type="PackedStringArray" />
<description>
Returns a [PackedStringArray] of positional tracker names that are used within the extension wrapper.
</description>
</method>
<method name="_get_viewport_composition_layer_extension_properties" qualifiers="virtual">
<return type="Dictionary[]" />
<description>
Gets an array of [Dictionary]s that represent properties, just like [method Object._get_property_list], that will be added to [OpenXRCompositionLayer] nodes.
</description>
</method>
<method name="_get_viewport_composition_layer_extension_property_defaults" qualifiers="virtual">
<return type="Dictionary" />
<description>
Gets a [Dictionary] containing the default values for the properties returned by [method _get_viewport_composition_layer_extension_properties].
</description>
</method>
<method name="_on_before_instance_created" qualifiers="virtual">
<return type="void" />
<description>
Called before the OpenXR instance is created.
</description>
</method>
<method name="_on_event_polled" qualifiers="virtual">
<return type="bool" />
<param index="0" name="event" type="const void*" />
<description>
Called when there is an OpenXR event to process. When implementing, return [code]true[/code] if the event was handled, return [code]false[/code] otherwise.
</description>
</method>
<method name="_on_instance_created" qualifiers="virtual">
<return type="void" />
<param index="0" name="instance" type="int" />
<description>
Called right after the OpenXR instance is created.
</description>
</method>
<method name="_on_instance_destroyed" qualifiers="virtual">
<return type="void" />
<description>
Called right before the OpenXR instance is destroyed.
</description>
</method>
<method name="_on_main_swapchains_created" qualifiers="virtual">
<return type="void" />
<description>
Called right after the main swapchains are (re)created.
</description>
</method>
<method name="_on_post_draw_viewport" qualifiers="virtual">
<return type="void" />
<param index="0" name="viewport" type="RID" />
<description>
Called right after the given viewport is rendered.
[b]Note:[/b] The draw commands might only be queued at this point, not executed.
</description>
</method>
<method name="_on_pre_draw_viewport" qualifiers="virtual">
<return type="void" />
<param index="0" name="viewport" type="RID" />
<description>
Called right before the given viewport is rendered.
</description>
</method>
<method name="_on_pre_render" qualifiers="virtual">
<return type="void" />
<description>
Called right before the XR viewports begin their rendering step.
</description>
</method>
<method name="_on_process" qualifiers="virtual">
<return type="void" />
<description>
Called as part of the OpenXR process handling. This happens right before general and physics processing steps of the main loop. During this step controller data is queried and made available to game logic.
</description>
</method>
<method name="_on_register_metadata" qualifiers="virtual">
<return type="void" />
<description>
Allows extensions to register additional controller metadata. This function is called even when the OpenXR API is not constructed as the metadata needs to be available to the editor.
Extensions should also provide metadata regardless of whether they are supported on the host system. The controller data is used to setup action maps for users who may have access to the relevant hardware.
</description>
</method>
<method name="_on_session_created" qualifiers="virtual">
<return type="void" />
<param index="0" name="session" type="int" />
<description>
Called right after the OpenXR session is created.
</description>
</method>
<method name="_on_session_destroyed" qualifiers="virtual">
<return type="void" />
<description>
Called right before the OpenXR session is destroyed.
</description>
</method>
<method name="_on_state_exiting" qualifiers="virtual">
<return type="void" />
<description>
Called when the OpenXR session state is changed to exiting.
</description>
</method>
<method name="_on_state_focused" qualifiers="virtual">
<return type="void" />
<description>
Called when the OpenXR session state is changed to focused. This state is the active state when the game runs.
</description>
</method>
<method name="_on_state_idle" qualifiers="virtual">
<return type="void" />
<description>
Called when the OpenXR session state is changed to idle.
</description>
</method>
<method name="_on_state_loss_pending" qualifiers="virtual">
<return type="void" />
<description>
Called when the OpenXR session state is changed to loss pending.
</description>
</method>
<method name="_on_state_ready" qualifiers="virtual">
<return type="void" />
<description>
Called when the OpenXR session state is changed to ready. This means OpenXR is ready to set up the session.
</description>
</method>
<method name="_on_state_stopping" qualifiers="virtual">
<return type="void" />
<description>
Called when the OpenXR session state is changed to stopping.
</description>
</method>
<method name="_on_state_synchronized" qualifiers="virtual">
<return type="void" />
<description>
Called when the OpenXR session state is changed to synchronized. OpenXR also returns to this state when the application loses focus.
</description>
</method>
<method name="_on_state_visible" qualifiers="virtual">
<return type="void" />
<description>
Called when the OpenXR session state is changed to visible. This means OpenXR is now ready to receive frames.
</description>
</method>
<method name="_on_sync_actions" qualifiers="virtual">
<return type="void" />
<description>
Called when OpenXR has performed its action sync.
</description>
</method>
<method name="_on_viewport_composition_layer_destroyed" qualifiers="virtual">
<return type="void" />
<param index="0" name="layer" type="const void*" />
<description>
Called when a composition layer created via [OpenXRCompositionLayer] is destroyed.
[param layer] is a pointer to an [code]XrCompositionLayerBaseHeader[/code] struct.
</description>
</method>
<method name="_set_android_surface_swapchain_create_info_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="property_values" type="Dictionary" />
<param index="1" name="next_pointer" type="void*" />
<description>
Adds additional data structures to Android surface swapchains created by [OpenXRCompositionLayer].
[param property_values] contains the values of the properties returned by [method _get_viewport_composition_layer_extension_properties].
</description>
</method>
<method name="_set_frame_end_info_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="next_pointer" type="void*" />
<description>
Adds additional data structures to [code]XrFrameEndInfo[/code].
This will only be called if the extension previously registered itself with [method OpenXRAPIExtension.register_frame_info_extension].
</description>
</method>
<method name="_set_frame_wait_info_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="next_pointer" type="void*" />
<description>
Adds additional data structures to [code]XrFrameWaitInfo[/code].
This will only be called if the extension previously registered itself with [method OpenXRAPIExtension.register_frame_info_extension].
</description>
</method>
<method name="_set_hand_joint_locations_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="hand_index" type="int" />
<param index="1" name="next_pointer" type="void*" />
<description>
Adds additional data structures when each hand tracker is created.
</description>
</method>
<method name="_set_instance_create_info_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="next_pointer" type="void*" />
<description>
Adds additional data structures when the OpenXR instance is created.
</description>
</method>
<method name="_set_projection_views_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="view_index" type="int" />
<param index="1" name="next_pointer" type="void*" />
<description>
Adds additional data structures to the projection view of the given [param view_index].
</description>
</method>
<method name="_set_reference_space_create_info_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="reference_space_type" type="int" />
<param index="1" name="next_pointer" type="void*" />
<description>
Adds additional data structures to [code]XrReferenceSpaceCreateInfo[/code].
</description>
</method>
<method name="_set_session_create_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="next_pointer" type="void*" />
<description>
Adds additional data structures when the OpenXR session is created.
</description>
</method>
<method name="_set_swapchain_create_info_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="next_pointer" type="void*" />
<description>
Adds additional data structures when creating OpenXR swapchains.
</description>
</method>
<method name="_set_system_properties_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="next_pointer" type="void*" />
<description>
Adds additional data structures when querying OpenXR system abilities.
</description>
</method>
<method name="_set_view_locate_info_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="next_pointer" type="void*" />
<description>
Adds additional data structures to [code]XrViewLocateInfo[/code].
This will only be called if the extension previously registered itself with [method OpenXRAPIExtension.register_frame_info_extension].
</description>
</method>
<method name="_set_viewport_composition_layer_and_get_next_pointer" qualifiers="virtual">
<return type="int" />
<param index="0" name="layer" type="const void*" />
<param index="1" name="property_values" type="Dictionary" />
<param index="2" name="next_pointer" type="void*" />
<description>
Adds additional data structures to composition layers created by [OpenXRCompositionLayer].
[param property_values] contains the values of the properties returned by [method _get_viewport_composition_layer_extension_properties].
[param layer] is a pointer to an [code]XrCompositionLayerBaseHeader[/code] struct.
</description>
</method>
<method name="get_openxr_api">
<return type="OpenXRAPIExtension" />
<description>
Returns the created [OpenXRAPIExtension], which can be used to access the OpenXR API.
</description>
</method>
<method name="register_extension_wrapper">
<return type="void" />
<description>
Registers the extension. This should happen at core module initialization level.
</description>
</method>
</methods>
</class>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRExtensionWrapperExtension" inherits="OpenXRExtensionWrapper" deprecated="Use [OpenXRExtensionWrapper] instead." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Allows implementing OpenXR extensions with GDExtension.
</brief_description>
<description>
[OpenXRExtensionWrapperExtension] allows implementing OpenXR extensions with GDExtension. The extension should be registered with [method OpenXRExtensionWrapper.register_extension_wrapper].
</description>
<tutorials>
</tutorials>
</class>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRFutureExtension" inherits="OpenXRExtensionWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
The OpenXR Future extension allows for asynchronous APIs to be used.
</brief_description>
<description>
This is a support extension in OpenXR that allows other OpenXR extensions to start asynchronous functions and get a callback after this function finishes. It is not intended for consumption within GDScript but can be accessed from GDExtension.
</description>
<tutorials>
</tutorials>
<methods>
<method name="cancel_future">
<return type="void" />
<param index="0" name="future" type="int" />
<description>
Cancels an in-progress future. [param future] must be an [code]XrFutureEXT[/code] value previously returned by an API that started an asynchronous function.
</description>
</method>
<method name="is_active" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if futures are available in the OpenXR runtime used. This function will only return a usable result after OpenXR has been initialized.
</description>
</method>
<method name="register_future">
<return type="OpenXRFutureResult" />
<param index="0" name="future" type="int" />
<param index="1" name="on_success" type="Callable" default="Callable()" />
<description>
Register an OpenXR Future object so we monitor for completion. [param future] must be an [code]XrFutureEXT[/code] value previously returned by an API that started an asynchronous function.
You can optionally specify [param on_success], it will be invoked on successful completion of the future.
Or you can use the returned [OpenXRFutureResult] object to [code]await[/code] its [signal OpenXRFutureResult.completed] signal.
[codeblock]
var future_result = OpenXRFutureExtension.register_future(future)
await future_result.completed
if future_result.get_status() == OpenXRFutureResult.RESULT_FINISHED:
# Handle your success
pass
[/codeblock]
</description>
</method>
</methods>
</class>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRFutureResult" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Result object tracking the asynchronous result of an OpenXR Future object.
</brief_description>
<description>
Result object tracking the asynchronous result of an OpenXR Future object, you can use this object to track the result status.
</description>
<tutorials>
</tutorials>
<methods>
<method name="cancel_future">
<return type="void" />
<description>
Cancel this future, this will interrupt and stop the asynchronous function.
</description>
</method>
<method name="get_future" qualifiers="const">
<return type="int" />
<description>
Return the [code]XrFutureEXT[/code] value this result relates to.
</description>
</method>
<method name="get_result_value" qualifiers="const">
<return type="Variant" />
<description>
Returns the result value of our asynchronous function (if set by the extension). The type of this result value depends on the function being called. Consult the documentation of the relevant function.
</description>
</method>
<method name="get_status" qualifiers="const">
<return type="int" enum="OpenXRFutureResult.ResultStatus" />
<description>
Returns the status of this result.
</description>
</method>
<method name="set_result_value">
<return type="void" />
<param index="0" name="result_value" type="Variant" />
<description>
Stores the result value we expose to the user.
[b]Note:[/b] This method should only be called by an OpenXR extension that implements an asynchronous function.
</description>
</method>
</methods>
<signals>
<signal name="completed">
<param index="0" name="result" type="OpenXRFutureResult" />
<description>
Emitted when the asynchronous function is finished or has been cancelled.
</description>
</signal>
</signals>
<constants>
<constant name="RESULT_RUNNING" value="0" enum="ResultStatus">
The asynchronous function is running.
</constant>
<constant name="RESULT_FINISHED" value="1" enum="ResultStatus">
The asynchronous function has finished.
</constant>
<constant name="RESULT_CANCELLED" value="2" enum="ResultStatus">
The asynchronous function has been cancelled.
</constant>
</constants>
</class>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRHand" inherits="Node3D" deprecated="Use [XRHandModifier3D] instead." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Node supporting hand and finger tracking in OpenXR.
</brief_description>
<description>
This node enables OpenXR's hand tracking functionality. The node should be a child node of an [XROrigin3D] node, tracking will update its position to the player's tracked hand Palm joint location (the center of the middle finger's metacarpal bone). This node also updates the skeleton of a properly skinned hand or avatar model.
If the skeleton is a hand (one of the hand bones is the root node of the skeleton), then the skeleton will be placed relative to the hand palm location and the hand mesh and skeleton should be children of the OpenXRHand node.
If the hand bones are part of a full skeleton, then the root of the hand will keep its location with the assumption that IK is used to position the hand and arm.
By default the skeleton hand bones are repositioned to match the size of the tracked hand. To preserve the modeled bone sizes change [member bone_update] to apply rotation only.
</description>
<tutorials>
</tutorials>
<members>
<member name="bone_update" type="int" setter="set_bone_update" getter="get_bone_update" enum="OpenXRHand.BoneUpdate" default="0">
Specify the type of updates to perform on the bone.
</member>
<member name="hand" type="int" setter="set_hand" getter="get_hand" enum="OpenXRHand.Hands" default="0">
Specifies whether this node tracks the left or right hand of the player.
</member>
<member name="hand_skeleton" type="NodePath" setter="set_hand_skeleton" getter="get_hand_skeleton" default="NodePath(&quot;&quot;)">
Set a [Skeleton3D] node for which the pose positions will be updated.
</member>
<member name="motion_range" type="int" setter="set_motion_range" getter="get_motion_range" enum="OpenXRHand.MotionRange" default="0">
Set the motion range (if supported) limiting the hand motion.
</member>
<member name="skeleton_rig" type="int" setter="set_skeleton_rig" getter="get_skeleton_rig" enum="OpenXRHand.SkeletonRig" default="0">
Set the type of skeleton rig the [member hand_skeleton] is compliant with.
</member>
</members>
<constants>
<constant name="HAND_LEFT" value="0" enum="Hands">
Tracking the player's left hand.
</constant>
<constant name="HAND_RIGHT" value="1" enum="Hands">
Tracking the player's right hand.
</constant>
<constant name="HAND_MAX" value="2" enum="Hands">
Maximum supported hands.
</constant>
<constant name="MOTION_RANGE_UNOBSTRUCTED" value="0" enum="MotionRange">
When player grips, hand skeleton will form a full fist.
</constant>
<constant name="MOTION_RANGE_CONFORM_TO_CONTROLLER" value="1" enum="MotionRange">
When player grips, hand skeleton conforms to the controller the player is holding.
</constant>
<constant name="MOTION_RANGE_MAX" value="2" enum="MotionRange">
Maximum supported motion ranges.
</constant>
<constant name="SKELETON_RIG_OPENXR" value="0" enum="SkeletonRig">
An OpenXR compliant skeleton.
</constant>
<constant name="SKELETON_RIG_HUMANOID" value="1" enum="SkeletonRig">
A [SkeletonProfileHumanoid] compliant skeleton.
</constant>
<constant name="SKELETON_RIG_MAX" value="2" enum="SkeletonRig">
Maximum supported hands.
</constant>
<constant name="BONE_UPDATE_FULL" value="0" enum="BoneUpdate">
The skeletons bones are fully updated (both position and rotation) to match the tracked bones.
</constant>
<constant name="BONE_UPDATE_ROTATION_ONLY" value="1" enum="BoneUpdate">
The skeletons bones are only rotated to align with the tracked bones, preserving bone length.
</constant>
<constant name="BONE_UPDATE_MAX" value="2" enum="BoneUpdate">
Maximum supported bone update mode.
</constant>
</constants>
</class>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRHapticBase" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
OpenXR Haptic feedback base class.
</brief_description>
<description>
This is a base class for haptic feedback resources.
</description>
<tutorials>
</tutorials>
</class>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRHapticVibration" inherits="OpenXRHapticBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vibration haptic feedback.
</brief_description>
<description>
This haptic feedback resource makes it possible to define a vibration based haptic feedback pulse that can be triggered through actions in the OpenXR action map.
</description>
<tutorials>
</tutorials>
<members>
<member name="amplitude" type="float" setter="set_amplitude" getter="get_amplitude" default="1.0">
The amplitude of the pulse between [code]0.0[/code] and [code]1.0[/code].
</member>
<member name="duration" type="int" setter="set_duration" getter="get_duration" default="-1">
The duration of the pulse in nanoseconds. Use [code]-1[/code] for a minimum duration pulse for the current XR runtime.
</member>
<member name="frequency" type="float" setter="set_frequency" getter="get_frequency" default="0.0">
The frequency of the pulse in Hz. [code]0.0[/code] will let the XR runtime chose an optimal frequency for the device used.
</member>
</members>
</class>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRIPBinding" inherits="Resource" 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 [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.
</description>
<tutorials>
</tutorials>
<methods>
<method name="add_path" deprecated="Binding is for a single path.">
<return type="void" />
<param index="0" name="path" type="String" />
<description>
Add an input/output path to this binding.
</description>
</method>
<method name="get_binding_modifier" qualifiers="const">
<return type="OpenXRActionBindingModifier" />
<param index="0" name="index" type="int" />
<description>
Get the [OpenXRBindingModifier] at this index.
</description>
</method>
<method name="get_binding_modifier_count" qualifiers="const">
<return type="int" />
<description>
Get the number of binding modifiers for this binding.
</description>
</method>
<method name="get_path_count" qualifiers="const" deprecated="Binding is for a single path.">
<return type="int" />
<description>
Get the number of input/output paths in this binding.
</description>
</method>
<method name="has_path" qualifiers="const" deprecated="Binding is for a single path.">
<return type="bool" />
<param index="0" name="path" type="String" />
<description>
Returns [code]true[/code] if this input/output path is part of this binding.
</description>
</method>
<method name="remove_path" deprecated="Binding is for a single path.">
<return type="void" />
<param index="0" name="path" type="String" />
<description>
Removes this input/output path from this binding.
</description>
</method>
</methods>
<members>
<member name="action" type="OpenXRAction" setter="set_action" getter="get_action">
[OpenXRAction] that is bound to [member binding_path].
</member>
<member name="binding_modifiers" type="Array" setter="set_binding_modifiers" getter="get_binding_modifiers" default="[]">
Binding modifiers for this binding.
</member>
<member name="binding_path" type="String" setter="set_binding_path" getter="get_binding_path" default="&quot;&quot;">
Binding path that defines the input or output bound to [member action].
[b]Note:[/b] Binding paths are suggestions, an XR runtime may choose to bind the action to a different input or output emulating this input or output.
</member>
<member name="paths" type="PackedStringArray" setter="set_paths" getter="get_paths" deprecated="Use [member binding_path] instead.">
Paths that define the inputs or outputs bound on the device.
</member>
</members>
</class>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRIPBindingModifier" inherits="OpenXRBindingModifier" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Binding modifier that applies directly on an interaction profile.
</brief_description>
<description>
Binding modifier that applies directly on an interaction profile.
</description>
<tutorials>
</tutorials>
</class>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRInteractionProfile" inherits="Resource" 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 metadata 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>
<methods>
<method name="get_binding" qualifiers="const">
<return type="OpenXRIPBinding" />
<param index="0" name="index" type="int" />
<description>
Retrieve the binding at this index.
</description>
</method>
<method name="get_binding_count" qualifiers="const">
<return type="int" />
<description>
Get the number of bindings in this interaction profile.
</description>
</method>
<method name="get_binding_modifier" qualifiers="const">
<return type="OpenXRIPBindingModifier" />
<param index="0" name="index" type="int" />
<description>
Get the [OpenXRBindingModifier] at this index.
</description>
</method>
<method name="get_binding_modifier_count" qualifiers="const">
<return type="int" />
<description>
Get the number of binding modifiers in this interaction profile.
</description>
</method>
</methods>
<members>
<member name="binding_modifiers" type="Array" setter="set_binding_modifiers" getter="get_binding_modifiers" default="[]">
Binding modifiers for this interaction profile.
</member>
<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>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRInteractionProfileEditor" inherits="OpenXRInteractionProfileEditorBase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Default OpenXR interaction profile editor.
</brief_description>
<description>
This is the default OpenXR interaction profile editor that provides a generic interface for editing any interaction profile for which no custom editor has been defined.
</description>
<tutorials>
</tutorials>
</class>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRInteractionProfileEditorBase" inherits="HBoxContainer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Base class for editing interaction profiles.
</brief_description>
<description>
This is a base class for interaction profile editors used by the OpenXR action map editor. It can be used to create bespoke editors for specific interaction profiles.
</description>
<tutorials>
</tutorials>
<methods>
<method name="setup">
<return type="void" />
<param index="0" name="action_map" type="OpenXRActionMap" />
<param index="1" name="interaction_profile" type="OpenXRInteractionProfile" />
<description>
Setup this editor for the provided [param action_map] and [param interaction_profile].
</description>
</method>
</methods>
<members>
<member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="3" />
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" overrides="Control" enum="Control.SizeFlags" is_bitfield="true" default="3" />
</members>
</class>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRInteractionProfileMetadata" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Meta class registering supported devices in OpenXR.
</brief_description>
<description>
This class allows OpenXR core and extensions to register metadata relating to supported interaction devices such as controllers, trackers, haptic devices, etc. It is primarily used by the action map editor and to sanitize any action map by removing extension-dependent entries when applicable.
</description>
<tutorials>
</tutorials>
<methods>
<method name="register_interaction_profile">
<return type="void" />
<param index="0" name="display_name" type="String" />
<param index="1" name="openxr_path" type="String" />
<param index="2" name="openxr_extension_name" type="String" />
<description>
Registers an interaction profile using its OpenXR designation (e.g. [code]/interaction_profiles/khr/simple_controller[/code] is the profile for OpenXR's simple controller profile).
[param display_name] is the description shown to the user. [param openxr_path] is the interaction profile path being registered. [param openxr_extension_name] optionally restricts this profile to the given extension being enabled/available. If the extension is not available, the profile and all related entries used in an action map are filtered out.
</description>
</method>
<method name="register_io_path">
<return type="void" />
<param index="0" name="interaction_profile" type="String" />
<param index="1" name="display_name" type="String" />
<param index="2" name="toplevel_path" type="String" />
<param index="3" name="openxr_path" type="String" />
<param index="4" name="openxr_extension_name" type="String" />
<param index="5" name="action_type" type="int" enum="OpenXRAction.ActionType" />
<description>
Registers an input/output path for the given [param interaction_profile]. The profile should previously have been registered using [method register_interaction_profile]. [param display_name] is the description shown to the user. [param toplevel_path] specifies the bind path this input/output can be bound to (e.g. [code]/user/hand/left[/code] or [code]/user/hand/right[/code]). [param openxr_path] is the action input/output being registered (e.g. [code]/user/hand/left/input/aim/pose[/code]). [param openxr_extension_name] restricts this input/output to an enabled/available extension, this doesn't need to repeat the extension on the profile but relates to overlapping extension (e.g. [code]XR_EXT_palm_pose[/code] that introduces [code]…/input/palm_ext/pose[/code] input paths). [param action_type] defines the type of input or output provided by OpenXR.
</description>
</method>
<method name="register_profile_rename">
<return type="void" />
<param index="0" name="old_name" type="String" />
<param index="1" name="new_name" type="String" />
<description>
Allows for renaming old interaction profile paths to new paths to maintain backwards compatibility with older action maps.
</description>
</method>
<method name="register_top_level_path">
<return type="void" />
<param index="0" name="display_name" type="String" />
<param index="1" name="openxr_path" type="String" />
<param index="2" name="openxr_extension_name" type="String" />
<description>
Registers a top level path to which profiles can be bound. For instance [code]/user/hand/left[/code] refers to the bind point for the player's left hand. Extensions can register additional top level paths, for instance a haptic vest extension might register [code]/user/body/vest[/code].
[param display_name] is the name shown to the user. [param openxr_path] is the top level path being registered. [param openxr_extension_name] is optional and ensures the top level path is only used if the specified extension is available/enabled.
When a top level path ends up being bound by OpenXR, an [XRPositionalTracker] is instantiated to manage the state of the device.
</description>
</method>
</methods>
</class>

View File

@@ -0,0 +1,442 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRInterface" inherits="XRInterface" 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 than other plugin based XR interfaces. It needs to be initialized 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="Setting up XR">$DOCS_URL/tutorials/xr/setting_up_xr.html</link>
</tutorials>
<methods>
<method name="get_action_sets" qualifiers="const">
<return type="Array" />
<description>
Returns a list of action sets registered with Godot (loaded from the action map at runtime).
</description>
</method>
<method name="get_available_display_refresh_rates" qualifiers="const">
<return type="Array" />
<description>
Returns display refresh rates supported by the current HMD. Only returned if this feature is supported by the OpenXR runtime and after the interface has been initialized.
</description>
</method>
<method name="get_hand_joint_angular_velocity" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_angular_velocity] obtained from [method XRServer.get_tracker] instead.">
<return type="Vector3" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />
<description>
If handtracking is enabled, returns the angular velocity of a joint ([param joint]) of a hand ([param hand]) as provided by OpenXR. This is relative to [XROrigin3D]!
</description>
</method>
<method name="get_hand_joint_flags" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_flags] obtained from [method XRServer.get_tracker] instead.">
<return type="int" enum="OpenXRInterface.HandJointFlags" is_bitfield="true" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />
<description>
If handtracking is enabled, returns flags that inform us of the validity of the tracking data.
</description>
</method>
<method name="get_hand_joint_linear_velocity" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_linear_velocity] obtained from [method XRServer.get_tracker] instead.">
<return type="Vector3" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />
<description>
If handtracking is enabled, returns the linear velocity of a joint ([param joint]) of a hand ([param hand]) as provided by OpenXR. This is relative to [XROrigin3D] without worldscale applied!
</description>
</method>
<method name="get_hand_joint_position" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_transform] obtained from [method XRServer.get_tracker] instead.">
<return type="Vector3" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />
<description>
If handtracking is enabled, returns the position of a joint ([param joint]) of a hand ([param hand]) as provided by OpenXR. This is relative to [XROrigin3D] without worldscale applied!
</description>
</method>
<method name="get_hand_joint_radius" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_radius] obtained from [method XRServer.get_tracker] instead.">
<return type="float" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />
<description>
If handtracking is enabled, returns the radius of a joint ([param joint]) of a hand ([param hand]) as provided by OpenXR. This is without worldscale applied!
</description>
</method>
<method name="get_hand_joint_rotation" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_transform] obtained from [method XRServer.get_tracker] instead.">
<return type="Quaternion" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />
<description>
If handtracking is enabled, returns the rotation of a joint ([param joint]) of a hand ([param hand]) as provided by OpenXR.
</description>
</method>
<method name="get_hand_tracking_source" qualifiers="const" deprecated="Use [member XRHandTracker.hand_tracking_source] obtained from [method XRServer.get_tracker] instead.">
<return type="int" enum="OpenXRInterface.HandTrackedSource" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<description>
If handtracking is enabled and hand tracking source is supported, gets the source of the hand tracking data for [param hand].
</description>
</method>
<method name="get_motion_range" qualifiers="const">
<return type="int" enum="OpenXRInterface.HandMotionRange" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<description>
If handtracking is enabled and motion range is supported, gets the currently configured motion range for [param hand].
</description>
</method>
<method name="get_session_state">
<return type="int" enum="OpenXRInterface.SessionState" />
<description>
Returns the current state of our OpenXR session.
</description>
</method>
<method name="is_action_set_active" qualifiers="const">
<return type="bool" />
<param index="0" name="name" type="String" />
<description>
Returns [code]true[/code] if the given action set is active.
</description>
</method>
<method name="is_eye_gaze_interaction_supported">
<return type="bool" />
<description>
Returns the capabilities of the eye gaze interaction extension.
[b]Note:[/b] This only returns a valid value after OpenXR has been initialized.
</description>
</method>
<method name="is_foveation_supported" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if OpenXR's foveation extension is supported, the interface must be initialized before this returns a valid value.
[b]Note:[/b] This feature is only available on the Compatibility renderer and currently only available on some stand alone headsets. For Vulkan set [member Viewport.vrs_mode] to [code]VRS_XR[/code] on desktop.
</description>
</method>
<method name="is_hand_interaction_supported" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if OpenXR's hand interaction profile is supported and enabled.
[b]Note:[/b] This only returns a valid value after OpenXR has been initialized.
</description>
</method>
<method name="is_hand_tracking_supported">
<return type="bool" />
<description>
Returns [code]true[/code] if OpenXR's hand tracking is supported and enabled.
[b]Note:[/b] This only returns a valid value after OpenXR has been initialized.
</description>
</method>
<method name="set_action_set_active">
<return type="void" />
<param index="0" name="name" type="String" />
<param index="1" name="active" type="bool" />
<description>
Sets the given action set as active or inactive.
</description>
</method>
<method name="set_cpu_level">
<return type="void" />
<param index="0" name="level" type="int" enum="OpenXRInterface.PerfSettingsLevel" />
<description>
Sets the CPU performance level of the OpenXR device.
</description>
</method>
<method name="set_gpu_level">
<return type="void" />
<param index="0" name="level" type="int" enum="OpenXRInterface.PerfSettingsLevel" />
<description>
Sets the GPU performance level of the OpenXR device.
</description>
</method>
<method name="set_motion_range">
<return type="void" />
<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />
<param index="1" name="motion_range" type="int" enum="OpenXRInterface.HandMotionRange" />
<description>
If handtracking is enabled and motion range is supported, sets the currently configured motion range for [param hand] to [param motion_range].
</description>
</method>
</methods>
<members>
<member name="display_refresh_rate" type="float" setter="set_display_refresh_rate" getter="get_display_refresh_rate" default="0.0">
The display refresh rate for the current HMD. Only functional if this feature is supported by the OpenXR runtime and after the interface has been initialized.
</member>
<member name="foveation_dynamic" type="bool" setter="set_foveation_dynamic" getter="get_foveation_dynamic" default="false">
Enable dynamic foveation adjustment, the interface must be initialized before this is accessible. If enabled foveation will automatically adjusted between low and [member foveation_level].
[b]Note:[/b] Only works on the Compatibility renderer.
</member>
<member name="foveation_level" type="int" setter="set_foveation_level" getter="get_foveation_level" default="0">
Set foveation level from 0 (off) to 3 (high), the interface must be initialized before this is accessible.
[b]Note:[/b] Only works on the Compatibility renderer.
</member>
<member name="render_target_size_multiplier" type="float" setter="set_render_target_size_multiplier" getter="get_render_target_size_multiplier" default="1.0">
The render size multiplier for the current HMD. Must be set before the interface has been initialized.
</member>
<member name="vrs_min_radius" type="float" setter="set_vrs_min_radius" getter="get_vrs_min_radius" default="20.0">
The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size.
[b]Note:[/b] Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR].
</member>
<member name="vrs_strength" type="float" setter="set_vrs_strength" getter="get_vrs_strength" default="1.0">
The strength used to calculate the VRS density map. The greater this value, the more noticeable VRS is. This improves performance at the cost of quality.
[b]Note:[/b] Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR].
</member>
</members>
<signals>
<signal name="cpu_level_changed">
<param index="0" name="sub_domain" type="int" />
<param index="1" name="from_level" type="int" />
<param index="2" name="to_level" type="int" />
<description>
Informs the device CPU performance level has changed in the specified subdomain.
</description>
</signal>
<signal name="gpu_level_changed">
<param index="0" name="sub_domain" type="int" />
<param index="1" name="from_level" type="int" />
<param index="2" name="to_level" type="int" />
<description>
Informs the device GPU performance level has changed in the specified subdomain.
</description>
</signal>
<signal name="instance_exiting">
<description>
Informs our OpenXR instance is exiting.
</description>
</signal>
<signal name="pose_recentered">
<description>
Informs the user queued a recenter of the player position.
</description>
</signal>
<signal name="refresh_rate_changed">
<param index="0" name="refresh_rate" type="float" />
<description>
Informs the user the HMD refresh rate has changed.
[b]Note:[/b] Only emitted if XR runtime supports the refresh rate extension.
</description>
</signal>
<signal name="session_begun">
<description>
Informs our OpenXR session has been started.
</description>
</signal>
<signal name="session_focussed">
<description>
Informs our OpenXR session now has focus, for example output is sent to the HMD and we're receiving XR input.
</description>
</signal>
<signal name="session_loss_pending">
<description>
Informs our OpenXR session is in the process of being lost.
</description>
</signal>
<signal name="session_stopping">
<description>
Informs our OpenXR session is stopping.
</description>
</signal>
<signal name="session_synchronized">
<description>
Informs our OpenXR session has been synchronized.
</description>
</signal>
<signal name="session_visible">
<description>
Informs our OpenXR session is now visible, for example output is sent to the HMD but we don't receive XR input.
</description>
</signal>
</signals>
<constants>
<constant name="SESSION_STATE_UNKNOWN" value="0" enum="SessionState">
The state of the session is unknown, we haven't tried setting up OpenXR yet.
</constant>
<constant name="SESSION_STATE_IDLE" value="1" enum="SessionState">
The initial state after the OpenXR session is created or after the session is destroyed.
</constant>
<constant name="SESSION_STATE_READY" value="2" enum="SessionState">
OpenXR is ready to begin our session. [signal session_begun] is emitted when we change to this state.
</constant>
<constant name="SESSION_STATE_SYNCHRONIZED" value="3" enum="SessionState">
The application has synched its frame loop with the runtime but we're not rendering anything. [signal session_synchronized] is emitted when we change to this state.
</constant>
<constant name="SESSION_STATE_VISIBLE" value="4" enum="SessionState">
The application has synched its frame loop with the runtime and we're rendering output to the user, however we receive no user input. [signal session_visible] is emitted when we change to this state.
[b]Note:[/b] This is the current state just before we get the focused state, whenever the user opens a system menu, switches to another application, or takes off their headset.
</constant>
<constant name="SESSION_STATE_FOCUSED" value="5" enum="SessionState">
The application has synched its frame loop with the runtime, we're rendering output to the user and we're receiving XR input. [signal session_focussed] is emitted when we change to this state.
[b]Note:[/b] This is the state OpenXR will be in when the user can fully interact with your game.
</constant>
<constant name="SESSION_STATE_STOPPING" value="6" enum="SessionState">
Our session is being stopped. [signal session_stopping] is emitted when we change to this state.
</constant>
<constant name="SESSION_STATE_LOSS_PENDING" value="7" enum="SessionState">
The session is about to be lost. [signal session_loss_pending] is emitted when we change to this state.
</constant>
<constant name="SESSION_STATE_EXITING" value="8" enum="SessionState">
The OpenXR instance is about to be destroyed and we're existing. [signal instance_exiting] is emitted when we change to this state.
</constant>
<constant name="HAND_LEFT" value="0" enum="Hand">
Left hand.
</constant>
<constant name="HAND_RIGHT" value="1" enum="Hand">
Right hand.
</constant>
<constant name="HAND_MAX" value="2" enum="Hand">
Maximum value for the hand enum.
</constant>
<constant name="HAND_MOTION_RANGE_UNOBSTRUCTED" value="0" enum="HandMotionRange">
Full hand range, if user closes their hands, we make a full fist.
</constant>
<constant name="HAND_MOTION_RANGE_CONFORM_TO_CONTROLLER" value="1" enum="HandMotionRange">
Conform to controller, if user closes their hands, the tracked data conforms to the shape of the controller.
</constant>
<constant name="HAND_MOTION_RANGE_MAX" value="2" enum="HandMotionRange">
Maximum value for the motion range enum.
</constant>
<constant name="HAND_TRACKED_SOURCE_UNKNOWN" value="0" enum="HandTrackedSource">
The source of hand tracking data is unknown (the extension is likely unsupported).
</constant>
<constant name="HAND_TRACKED_SOURCE_UNOBSTRUCTED" value="1" enum="HandTrackedSource">
The source of hand tracking is unobstructed, this means that an accurate method of hand tracking is used, e.g. optical hand tracking, data gloves, etc.
</constant>
<constant name="HAND_TRACKED_SOURCE_CONTROLLER" value="2" enum="HandTrackedSource">
The source of hand tracking is a controller, bone positions are inferred from controller inputs.
</constant>
<constant name="HAND_TRACKED_SOURCE_MAX" value="3" enum="HandTrackedSource">
Represents the size of the [enum HandTrackedSource] enum.
</constant>
<constant name="HAND_JOINT_PALM" value="0" enum="HandJoints">
Palm joint.
</constant>
<constant name="HAND_JOINT_WRIST" value="1" enum="HandJoints">
Wrist joint.
</constant>
<constant name="HAND_JOINT_THUMB_METACARPAL" value="2" enum="HandJoints">
Thumb metacarpal joint.
</constant>
<constant name="HAND_JOINT_THUMB_PROXIMAL" value="3" enum="HandJoints">
Thumb proximal joint.
</constant>
<constant name="HAND_JOINT_THUMB_DISTAL" value="4" enum="HandJoints">
Thumb distal joint.
</constant>
<constant name="HAND_JOINT_THUMB_TIP" value="5" enum="HandJoints">
Thumb tip joint.
</constant>
<constant name="HAND_JOINT_INDEX_METACARPAL" value="6" enum="HandJoints">
Index finger metacarpal joint.
</constant>
<constant name="HAND_JOINT_INDEX_PROXIMAL" value="7" enum="HandJoints">
Index finger phalanx proximal joint.
</constant>
<constant name="HAND_JOINT_INDEX_INTERMEDIATE" value="8" enum="HandJoints">
Index finger phalanx intermediate joint.
</constant>
<constant name="HAND_JOINT_INDEX_DISTAL" value="9" enum="HandJoints">
Index finger phalanx distal joint.
</constant>
<constant name="HAND_JOINT_INDEX_TIP" value="10" enum="HandJoints">
Index finger tip joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_METACARPAL" value="11" enum="HandJoints">
Middle finger metacarpal joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_PROXIMAL" value="12" enum="HandJoints">
Middle finger phalanx proximal joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_INTERMEDIATE" value="13" enum="HandJoints">
Middle finger phalanx intermediate joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_DISTAL" value="14" enum="HandJoints">
Middle finger phalanx distal joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_TIP" value="15" enum="HandJoints">
Middle finger tip joint.
</constant>
<constant name="HAND_JOINT_RING_METACARPAL" value="16" enum="HandJoints">
Ring finger metacarpal joint.
</constant>
<constant name="HAND_JOINT_RING_PROXIMAL" value="17" enum="HandJoints">
Ring finger phalanx proximal joint.
</constant>
<constant name="HAND_JOINT_RING_INTERMEDIATE" value="18" enum="HandJoints">
Ring finger phalanx intermediate joint.
</constant>
<constant name="HAND_JOINT_RING_DISTAL" value="19" enum="HandJoints">
Ring finger phalanx distal joint.
</constant>
<constant name="HAND_JOINT_RING_TIP" value="20" enum="HandJoints">
Ring finger tip joint.
</constant>
<constant name="HAND_JOINT_LITTLE_METACARPAL" value="21" enum="HandJoints">
Pinky finger metacarpal joint.
</constant>
<constant name="HAND_JOINT_LITTLE_PROXIMAL" value="22" enum="HandJoints">
Pinky finger phalanx proximal joint.
</constant>
<constant name="HAND_JOINT_LITTLE_INTERMEDIATE" value="23" enum="HandJoints">
Pinky finger phalanx intermediate joint.
</constant>
<constant name="HAND_JOINT_LITTLE_DISTAL" value="24" enum="HandJoints">
Pinky finger phalanx distal joint.
</constant>
<constant name="HAND_JOINT_LITTLE_TIP" value="25" enum="HandJoints">
Pinky finger tip joint.
</constant>
<constant name="HAND_JOINT_MAX" value="26" enum="HandJoints">
Represents the size of the [enum HandJoints] enum.
</constant>
<constant name="PERF_SETTINGS_LEVEL_POWER_SAVINGS" value="0" enum="PerfSettingsLevel">
The application has entered a non-XR section (head-locked / static screen), during which power savings are to be prioritized.
</constant>
<constant name="PERF_SETTINGS_LEVEL_SUSTAINED_LOW" value="1" enum="PerfSettingsLevel">
The application has entered a low and stable complexity section, during which reducing power is more important than occasional late rendering frames.
</constant>
<constant name="PERF_SETTINGS_LEVEL_SUSTAINED_HIGH" value="2" enum="PerfSettingsLevel">
The application has entered a high or dynamic complexity section, during which the XR Runtime strives for consistent XR compositing and frame rendering within a thermally sustainable range.
</constant>
<constant name="PERF_SETTINGS_LEVEL_BOOST" value="3" enum="PerfSettingsLevel">
The application has entered a section with very high complexity, during which the XR Runtime is allowed to step up beyond the thermally sustainable range.
</constant>
<constant name="PERF_SETTINGS_SUB_DOMAIN_COMPOSITING" value="0" enum="PerfSettingsSubDomain">
The compositing performance within the runtime has reached a new level.
</constant>
<constant name="PERF_SETTINGS_SUB_DOMAIN_RENDERING" value="1" enum="PerfSettingsSubDomain">
The application rendering performance has reached a new level.
</constant>
<constant name="PERF_SETTINGS_SUB_DOMAIN_THERMAL" value="2" enum="PerfSettingsSubDomain">
The temperature of the device has reached a new level.
</constant>
<constant name="PERF_SETTINGS_NOTIF_LEVEL_NORMAL" value="0" enum="PerfSettingsNotificationLevel">
The sub-domain has reached a level where no further actions other than currently applied are necessary.
</constant>
<constant name="PERF_SETTINGS_NOTIF_LEVEL_WARNING" value="1" enum="PerfSettingsNotificationLevel">
The sub-domain has reached an early warning level where the application should start proactive mitigation actions.
</constant>
<constant name="PERF_SETTINGS_NOTIF_LEVEL_IMPAIRED" value="2" enum="PerfSettingsNotificationLevel">
The sub-domain has reached a critical level where the application should start drastic mitigation actions.
</constant>
<constant name="HAND_JOINT_NONE" value="0" enum="HandJointFlags" is_bitfield="true">
No flags are set.
</constant>
<constant name="HAND_JOINT_ORIENTATION_VALID" value="1" enum="HandJointFlags" is_bitfield="true">
If set, the orientation data is valid, otherwise, the orientation data is unreliable and should not be used.
</constant>
<constant name="HAND_JOINT_ORIENTATION_TRACKED" value="2" enum="HandJointFlags" is_bitfield="true">
If set, the orientation data comes from tracking data, otherwise, the orientation data contains predicted data.
</constant>
<constant name="HAND_JOINT_POSITION_VALID" value="4" enum="HandJointFlags" is_bitfield="true">
If set, the positional data is valid, otherwise, the positional data is unreliable and should not be used.
</constant>
<constant name="HAND_JOINT_POSITION_TRACKED" value="8" enum="HandJointFlags" is_bitfield="true">
If set, the positional data comes from tracking data, otherwise, the positional data contains predicted data.
</constant>
<constant name="HAND_JOINT_LINEAR_VELOCITY_VALID" value="16" enum="HandJointFlags" is_bitfield="true">
If set, our linear velocity data is valid, otherwise, the linear velocity data is unreliable and should not be used.
</constant>
<constant name="HAND_JOINT_ANGULAR_VELOCITY_VALID" value="32" enum="HandJointFlags" is_bitfield="true">
If set, our angular velocity data is valid, otherwise, the angular velocity data is unreliable and should not be used.
</constant>
</constants>
</class>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRRenderModel" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
This node will display an OpenXR render model.
</brief_description>
<description>
This node will display an OpenXR render model by accessing the associated GLTF and processes all animation data (if supported by the XR runtime).
Render models were introduced to allow showing the correct model for the controller (or other device) the user has in hand, since the OpenXR action map does not provide information about the hardware used by the user. Note that while the controller (or device) can be somewhat inferred by the bound action map profile, this is a dangerous approach as the user may be using hardware not known at time of development and OpenXR will simply simulate an available interaction profile.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_top_level_path" qualifiers="const">
<return type="String" />
<description>
Returns the top level path related to this render model.
</description>
</method>
</methods>
<members>
<member name="render_model" type="RID" setter="set_render_model" getter="get_render_model" default="RID()">
The render model RID for the render model to load, as returned by [method OpenXRRenderModelExtension.render_model_create] or [method OpenXRRenderModelExtension.render_model_get_all].
</member>
</members>
<signals>
<signal name="render_model_top_level_path_changed">
<description>
Emitted when the top level path of this render model has changed.
</description>
</signal>
</signals>
</class>

View File

@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRRenderModelExtension" inherits="OpenXRExtensionWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
This class implements the OpenXR Render Model Extension.
</brief_description>
<description>
This class implements the OpenXR Render Model Extension, if enabled it will maintain a list of active render models and provides an interface to the render model data.
</description>
<tutorials>
</tutorials>
<methods>
<method name="is_active" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if OpenXR's render model extension is supported and enabled.
[b]Note:[/b] This only returns a valid value after OpenXR has been initialized.
</description>
</method>
<method name="render_model_create">
<return type="RID" />
<param index="0" name="render_model_id" type="int" />
<description>
Creates a render model object within OpenXR using a render model id.
[b]Note:[/b] This function is exposed for dependent OpenXR extensions that provide render model ids to be used with the render model extension.
</description>
</method>
<method name="render_model_destroy">
<return type="void" />
<param index="0" name="render_model" type="RID" />
<description>
Destroys a render model object within OpenXR that was previously created with [method render_model_create].
[b]Note:[/b] This function is exposed for dependent OpenXR extensions that provide render model ids to be used with the render model extension.
</description>
</method>
<method name="render_model_get_all">
<return type="RID[]" />
<description>
Returns an array of all currently active render models registered with this extension.
</description>
</method>
<method name="render_model_get_animatable_node_count" qualifiers="const">
<return type="int" />
<param index="0" name="render_model" type="RID" />
<description>
Returns the number of animatable nodes this render model has.
</description>
</method>
<method name="render_model_get_animatable_node_name" qualifiers="const">
<return type="String" />
<param index="0" name="render_model" type="RID" />
<param index="1" name="index" type="int" />
<description>
Returns the name of the given animatable node.
</description>
</method>
<method name="render_model_get_animatable_node_transform" qualifiers="const">
<return type="Transform3D" />
<param index="0" name="render_model" type="RID" />
<param index="1" name="index" type="int" />
<description>
Returns the current local transform for an animatable node. This is updated every frame.
</description>
</method>
<method name="render_model_get_confidence" qualifiers="const">
<return type="int" enum="XRPose.TrackingConfidence" />
<param index="0" name="render_model" type="RID" />
<description>
Returns the tracking confidence of the tracking data for the render model.
</description>
</method>
<method name="render_model_get_root_transform" qualifiers="const">
<return type="Transform3D" />
<param index="0" name="render_model" type="RID" />
<description>
Returns the root transform of a render model. This is the tracked position relative to our [XROrigin3D] node.
</description>
</method>
<method name="render_model_get_subaction_paths">
<return type="PackedStringArray" />
<param index="0" name="render_model" type="RID" />
<description>
Returns a list of active subaction paths for this [param render_model].
[b]Note:[/b] If different devices are bound to your actions than available in suggested interaction bindings, this information shows paths related to the interaction bindings being mimicked by that device.
</description>
</method>
<method name="render_model_get_top_level_path" qualifiers="const">
<return type="String" />
<param index="0" name="render_model" type="RID" />
<description>
Returns the top level path associated with this [param render_model]. If provided this identifies whether the render model is associated with the player's hands or other body part.
</description>
</method>
<method name="render_model_is_animatable_node_visible" qualifiers="const">
<return type="bool" />
<param index="0" name="render_model" type="RID" />
<param index="1" name="index" type="int" />
<description>
Returns [code]true[/code] if this animatable node should be visible.
</description>
</method>
<method name="render_model_new_scene_instance" qualifiers="const">
<return type="Node3D" />
<param index="0" name="render_model" type="RID" />
<description>
Returns an instance of a subscene that contains all [MeshInstance3D] nodes that allow you to visualize the render model.
</description>
</method>
</methods>
<signals>
<signal name="render_model_added">
<param index="0" name="render_model" type="RID" />
<description>
Emitted when a new render model is added.
</description>
</signal>
<signal name="render_model_removed">
<param index="0" name="render_model" type="RID" />
<description>
Emitted when a render model is removed.
</description>
</signal>
<signal name="render_model_top_level_path_changed">
<param index="0" name="render_model" type="RID" />
<description>
Emitted when the top level path associated with a render model changed.
</description>
</signal>
</signals>
</class>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRRenderModelManager" inherits="Node3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Helper node that will automatically manage displaying render models.
</brief_description>
<description>
This helper node will automatically manage displaying render models. It will create new [OpenXRRenderModel] nodes as controllers and other hand held devices are detected, and remove those nodes when they are deactivated.
[b]Note:[/b] If you want more control over this logic you can alternatively call [method OpenXRRenderModelExtension.render_model_get_all] to obtain a list of active render model ids and create [OpenXRRenderModel] instances for each render model id provided.
</description>
<tutorials>
</tutorials>
<members>
<member name="make_local_to_pose" type="String" setter="set_make_local_to_pose" getter="get_make_local_to_pose" default="&quot;&quot;">
Position render models local to this pose (this will adjust the position of the render models container node).
</member>
<member name="tracker" type="int" setter="set_tracker" getter="get_tracker" enum="OpenXRRenderModelManager.RenderModelTracker" default="0">
Limits render models to the specified tracker. Include: 0 = All render models, 1 = Render models not related to a tracker, 2 = Render models related to the left hand tracker, 3 = Render models related to the right hand tracker.
</member>
</members>
<signals>
<signal name="render_model_added">
<param index="0" name="render_model" type="OpenXRRenderModel" />
<description>
Emitted when a render model node is added as a child to this node.
</description>
</signal>
<signal name="render_model_removed">
<param index="0" name="render_model" type="OpenXRRenderModel" />
<description>
Emitted when a render model child node is about to be removed from this node.
</description>
</signal>
</signals>
<constants>
<constant name="RENDER_MODEL_TRACKER_ANY" value="0" enum="RenderModelTracker">
All active render models are shown regardless of what tracker they relate to.
</constant>
<constant name="RENDER_MODEL_TRACKER_NONE_SET" value="1" enum="RenderModelTracker">
Only active render models are shown that are not related to any tracker we manage.
</constant>
<constant name="RENDER_MODEL_TRACKER_LEFT_HAND" value="2" enum="RenderModelTracker">
Only active render models are shown that are related to the left hand tracker.
</constant>
<constant name="RENDER_MODEL_TRACKER_RIGHT_HAND" value="3" enum="RenderModelTracker">
Only active render models are shown that are related to the right hand tracker.
</constant>
</constants>
</class>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRVisibilityMask" inherits="VisualInstance3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Draws a stereo correct visibility mask.
</brief_description>
<description>
The visibility mask allows us to black out the part of the render result that is invisible due to lens distortion.
As this is rendered first, it prevents fragments with expensive lighting calculations to be processed as they are discarded through z-checking.
</description>
<tutorials>
</tutorials>
</class>