feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -225,18 +225,32 @@
</method>
<method name="register_composition_layer_provider">
<return type="void" />
<param index="0" name="extension" type="OpenXRExtensionWrapperExtension" />
<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="OpenXRExtensionWrapperExtension" />
<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" />
@ -290,14 +304,21 @@
</method>
<method name="unregister_composition_layer_provider">
<return type="void" />
<param index="0" name="extension" type="OpenXRExtensionWrapperExtension" />
<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="OpenXRExtensionWrapperExtension" />
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
<description>
Unregisters the given extension as a provider of additional data structures to projections views.
</description>

View file

@ -14,13 +14,13 @@
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 false.
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 true. It stays true until it falls under the [member off_threshold] value.
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

@ -53,10 +53,109 @@
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

@ -21,8 +21,8 @@
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 true.
If [code]true[/code], when the joystick remains in active dpad zone, this remains true even if we overlap with another zone.
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.
@ -31,10 +31,10 @@
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 true. It stays true until it falls under the [member threshold_released] value.
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 false.
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.5708">
The angle of each wedge that identifies the 4 directions of the emulated dpad.

View file

@ -0,0 +1,305 @@
<?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_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

@ -1,273 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="OpenXRExtensionWrapperExtension" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<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 clients to implement OpenXR extensions with GDExtension.
Allows implementing OpenXR extensions with GDExtension.
</brief_description>
<description>
[OpenXRExtensionWrapperExtension] allows clients to implement OpenXR extensions with GDExtension. The extension should be registered with [method register_extension_wrapper].
[OpenXRExtensionWrapperExtension] allows implementing OpenXR extensions with GDExtension. The extension should be registered with [method OpenXRExtensionWrapper.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_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_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_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_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,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,50 @@
<?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_status" qualifiers="const">
<return type="int" enum="OpenXRFutureResult.ResultStatus" />
<description>
Returns the status of this result.
</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

@ -128,6 +128,20 @@
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" />
@ -162,6 +176,22 @@
</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.
@ -234,7 +264,7 @@
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">
Maximum value for the hand tracked source enum.
Represents the size of the [enum HandTrackedSource] enum.
</constant>
<constant name="HAND_JOINT_PALM" value="0" enum="HandJoints">
Palm joint.
@ -255,67 +285,97 @@
Thumb tip joint.
</constant>
<constant name="HAND_JOINT_INDEX_METACARPAL" value="6" enum="HandJoints">
Index metacarpal joint.
Index finger metacarpal joint.
</constant>
<constant name="HAND_JOINT_INDEX_PROXIMAL" value="7" enum="HandJoints">
Index proximal joint.
Index finger phalanx proximal joint.
</constant>
<constant name="HAND_JOINT_INDEX_INTERMEDIATE" value="8" enum="HandJoints">
Index intermediate joint.
Index finger phalanx intermediate joint.
</constant>
<constant name="HAND_JOINT_INDEX_DISTAL" value="9" enum="HandJoints">
Index distal joint.
Index finger phalanx distal joint.
</constant>
<constant name="HAND_JOINT_INDEX_TIP" value="10" enum="HandJoints">
Index tip joint.
Index finger tip joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_METACARPAL" value="11" enum="HandJoints">
Middle metacarpal joint.
Middle finger metacarpal joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_PROXIMAL" value="12" enum="HandJoints">
Middle proximal joint.
Middle finger phalanx proximal joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_INTERMEDIATE" value="13" enum="HandJoints">
Middle intermediate joint.
Middle finger phalanx intermediate joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_DISTAL" value="14" enum="HandJoints">
Middle distal joint.
Middle finger phalanx distal joint.
</constant>
<constant name="HAND_JOINT_MIDDLE_TIP" value="15" enum="HandJoints">
Middle tip joint.
Middle finger tip joint.
</constant>
<constant name="HAND_JOINT_RING_METACARPAL" value="16" enum="HandJoints">
Ring metacarpal joint.
Ring finger metacarpal joint.
</constant>
<constant name="HAND_JOINT_RING_PROXIMAL" value="17" enum="HandJoints">
Ring proximal joint.
Ring finger phalanx proximal joint.
</constant>
<constant name="HAND_JOINT_RING_INTERMEDIATE" value="18" enum="HandJoints">
Ring intermediate joint.
Ring finger phalanx intermediate joint.
</constant>
<constant name="HAND_JOINT_RING_DISTAL" value="19" enum="HandJoints">
Ring distal joint.
Ring finger phalanx distal joint.
</constant>
<constant name="HAND_JOINT_RING_TIP" value="20" enum="HandJoints">
Ring tip joint.
Ring finger tip joint.
</constant>
<constant name="HAND_JOINT_LITTLE_METACARPAL" value="21" enum="HandJoints">
Little metacarpal joint.
Pinky finger metacarpal joint.
</constant>
<constant name="HAND_JOINT_LITTLE_PROXIMAL" value="22" enum="HandJoints">
Little proximal joint.
Pinky finger phalanx proximal joint.
</constant>
<constant name="HAND_JOINT_LITTLE_INTERMEDIATE" value="23" enum="HandJoints">
Little intermediate joint.
Pinky finger phalanx intermediate joint.
</constant>
<constant name="HAND_JOINT_LITTLE_DISTAL" value="24" enum="HandJoints">
Little distal joint.
Pinky finger phalanx distal joint.
</constant>
<constant name="HAND_JOINT_LITTLE_TIP" value="25" enum="HandJoints">
Little tip joint.
Pinky finger tip joint.
</constant>
<constant name="HAND_JOINT_MAX" value="26" enum="HandJoints">
Maximum value for the hand joint enum.
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.