godot-module-template/engine/modules/openxr/doc_classes/OpenXRInterface.xml
2025-04-12 18:40:44 +02:00

403 lines
21 KiB
XML

<?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="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 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 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.
</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_visible">
<description>
Informs our OpenXR session is now visible (output is being sent to the HMD).
</description>
</signal>
</signals>
<constants>
<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>