Path: blob/master/modules/openxr/doc_classes/OpenXRInterface.xml
10278 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="OpenXRInterface" inherits="XRInterface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3Our OpenXR interface.4</brief_description>5<description>6The OpenXR interface allows Godot to interact with OpenXR runtimes and make it possible to create XR experiences and games.7Due 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.8</description>9<tutorials>10<link title="Setting up XR">$DOCS_URL/tutorials/xr/setting_up_xr.html</link>11</tutorials>12<methods>13<method name="get_action_sets" qualifiers="const">14<return type="Array" />15<description>16Returns a list of action sets registered with Godot (loaded from the action map at runtime).17</description>18</method>19<method name="get_available_display_refresh_rates" qualifiers="const">20<return type="Array" />21<description>22Returns 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.23</description>24</method>25<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.">26<return type="Vector3" />27<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />28<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />29<description>30If 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]!31</description>32</method>33<method name="get_hand_joint_flags" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_flags] obtained from [method XRServer.get_tracker] instead.">34<return type="int" enum="OpenXRInterface.HandJointFlags" is_bitfield="true" />35<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />36<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />37<description>38If handtracking is enabled, returns flags that inform us of the validity of the tracking data.39</description>40</method>41<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.">42<return type="Vector3" />43<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />44<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />45<description>46If 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!47</description>48</method>49<method name="get_hand_joint_position" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_transform] obtained from [method XRServer.get_tracker] instead.">50<return type="Vector3" />51<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />52<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />53<description>54If 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!55</description>56</method>57<method name="get_hand_joint_radius" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_radius] obtained from [method XRServer.get_tracker] instead.">58<return type="float" />59<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />60<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />61<description>62If 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!63</description>64</method>65<method name="get_hand_joint_rotation" qualifiers="const" deprecated="Use [method XRHandTracker.get_hand_joint_transform] obtained from [method XRServer.get_tracker] instead.">66<return type="Quaternion" />67<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />68<param index="1" name="joint" type="int" enum="OpenXRInterface.HandJoints" />69<description>70If handtracking is enabled, returns the rotation of a joint ([param joint]) of a hand ([param hand]) as provided by OpenXR.71</description>72</method>73<method name="get_hand_tracking_source" qualifiers="const" deprecated="Use [member XRHandTracker.hand_tracking_source] obtained from [method XRServer.get_tracker] instead.">74<return type="int" enum="OpenXRInterface.HandTrackedSource" />75<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />76<description>77If handtracking is enabled and hand tracking source is supported, gets the source of the hand tracking data for [param hand].78</description>79</method>80<method name="get_motion_range" qualifiers="const">81<return type="int" enum="OpenXRInterface.HandMotionRange" />82<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />83<description>84If handtracking is enabled and motion range is supported, gets the currently configured motion range for [param hand].85</description>86</method>87<method name="get_session_state">88<return type="int" enum="OpenXRInterface.SessionState" />89<description>90Returns the current state of our OpenXR session.91</description>92</method>93<method name="is_action_set_active" qualifiers="const">94<return type="bool" />95<param index="0" name="name" type="String" />96<description>97Returns [code]true[/code] if the given action set is active.98</description>99</method>100<method name="is_eye_gaze_interaction_supported">101<return type="bool" />102<description>103Returns the capabilities of the eye gaze interaction extension.104[b]Note:[/b] This only returns a valid value after OpenXR has been initialized.105</description>106</method>107<method name="is_foveation_supported" qualifiers="const">108<return type="bool" />109<description>110Returns [code]true[/code] if OpenXR's foveation extension is supported, the interface must be initialized before this returns a valid value.111[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.112</description>113</method>114<method name="is_hand_interaction_supported" qualifiers="const">115<return type="bool" />116<description>117Returns [code]true[/code] if OpenXR's hand interaction profile is supported and enabled.118[b]Note:[/b] This only returns a valid value after OpenXR has been initialized.119</description>120</method>121<method name="is_hand_tracking_supported">122<return type="bool" />123<description>124Returns [code]true[/code] if OpenXR's hand tracking is supported and enabled.125[b]Note:[/b] This only returns a valid value after OpenXR has been initialized.126</description>127</method>128<method name="set_action_set_active">129<return type="void" />130<param index="0" name="name" type="String" />131<param index="1" name="active" type="bool" />132<description>133Sets the given action set as active or inactive.134</description>135</method>136<method name="set_cpu_level">137<return type="void" />138<param index="0" name="level" type="int" enum="OpenXRInterface.PerfSettingsLevel" />139<description>140Sets the CPU performance level of the OpenXR device.141</description>142</method>143<method name="set_gpu_level">144<return type="void" />145<param index="0" name="level" type="int" enum="OpenXRInterface.PerfSettingsLevel" />146<description>147Sets the GPU performance level of the OpenXR device.148</description>149</method>150<method name="set_motion_range">151<return type="void" />152<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />153<param index="1" name="motion_range" type="int" enum="OpenXRInterface.HandMotionRange" />154<description>155If handtracking is enabled and motion range is supported, sets the currently configured motion range for [param hand] to [param motion_range].156</description>157</method>158</methods>159<members>160<member name="display_refresh_rate" type="float" setter="set_display_refresh_rate" getter="get_display_refresh_rate" default="0.0">161The 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.162</member>163<member name="foveation_dynamic" type="bool" setter="set_foveation_dynamic" getter="get_foveation_dynamic" default="false">164Enable dynamic foveation adjustment, the interface must be initialized before this is accessible. If enabled foveation will automatically adjusted between low and [member foveation_level].165[b]Note:[/b] Only works on the Compatibility renderer.166</member>167<member name="foveation_level" type="int" setter="set_foveation_level" getter="get_foveation_level" default="0">168Set foveation level from 0 (off) to 3 (high), the interface must be initialized before this is accessible.169[b]Note:[/b] Only works on the Compatibility renderer.170</member>171<member name="render_target_size_multiplier" type="float" setter="set_render_target_size_multiplier" getter="get_render_target_size_multiplier" default="1.0">172The render size multiplier for the current HMD. Must be set before the interface has been initialized.173</member>174<member name="vrs_min_radius" type="float" setter="set_vrs_min_radius" getter="get_vrs_min_radius" default="20.0">175The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size.176[b]Note:[/b] Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR].177</member>178<member name="vrs_strength" type="float" setter="set_vrs_strength" getter="get_vrs_strength" default="1.0">179The 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.180[b]Note:[/b] Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR].181</member>182</members>183<signals>184<signal name="cpu_level_changed">185<param index="0" name="sub_domain" type="int" />186<param index="1" name="from_level" type="int" />187<param index="2" name="to_level" type="int" />188<description>189Informs the device CPU performance level has changed in the specified subdomain.190</description>191</signal>192<signal name="gpu_level_changed">193<param index="0" name="sub_domain" type="int" />194<param index="1" name="from_level" type="int" />195<param index="2" name="to_level" type="int" />196<description>197Informs the device GPU performance level has changed in the specified subdomain.198</description>199</signal>200<signal name="instance_exiting">201<description>202Informs our OpenXR instance is exiting.203</description>204</signal>205<signal name="pose_recentered">206<description>207Informs the user queued a recenter of the player position.208</description>209</signal>210<signal name="refresh_rate_changed">211<param index="0" name="refresh_rate" type="float" />212<description>213Informs the user the HMD refresh rate has changed.214[b]Note:[/b] Only emitted if XR runtime supports the refresh rate extension.215</description>216</signal>217<signal name="session_begun">218<description>219Informs our OpenXR session has been started.220</description>221</signal>222<signal name="session_focussed">223<description>224Informs our OpenXR session now has focus, for example output is sent to the HMD and we're receiving XR input.225</description>226</signal>227<signal name="session_loss_pending">228<description>229Informs our OpenXR session is in the process of being lost.230</description>231</signal>232<signal name="session_stopping">233<description>234Informs our OpenXR session is stopping.235</description>236</signal>237<signal name="session_synchronized">238<description>239Informs our OpenXR session has been synchronized.240</description>241</signal>242<signal name="session_visible">243<description>244Informs our OpenXR session is now visible, for example output is sent to the HMD but we don't receive XR input.245</description>246</signal>247</signals>248<constants>249<constant name="SESSION_STATE_UNKNOWN" value="0" enum="SessionState">250The state of the session is unknown, we haven't tried setting up OpenXR yet.251</constant>252<constant name="SESSION_STATE_IDLE" value="1" enum="SessionState">253The initial state after the OpenXR session is created or after the session is destroyed.254</constant>255<constant name="SESSION_STATE_READY" value="2" enum="SessionState">256OpenXR is ready to begin our session. [signal session_begun] is emitted when we change to this state.257</constant>258<constant name="SESSION_STATE_SYNCHRONIZED" value="3" enum="SessionState">259The 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.260</constant>261<constant name="SESSION_STATE_VISIBLE" value="4" enum="SessionState">262The 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.263[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.264</constant>265<constant name="SESSION_STATE_FOCUSED" value="5" enum="SessionState">266The 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.267[b]Note:[/b] This is the state OpenXR will be in when the user can fully interact with your game.268</constant>269<constant name="SESSION_STATE_STOPPING" value="6" enum="SessionState">270Our session is being stopped. [signal session_stopping] is emitted when we change to this state.271</constant>272<constant name="SESSION_STATE_LOSS_PENDING" value="7" enum="SessionState">273The session is about to be lost. [signal session_loss_pending] is emitted when we change to this state.274</constant>275<constant name="SESSION_STATE_EXITING" value="8" enum="SessionState">276The OpenXR instance is about to be destroyed and we're existing. [signal instance_exiting] is emitted when we change to this state.277</constant>278<constant name="HAND_LEFT" value="0" enum="Hand">279Left hand.280</constant>281<constant name="HAND_RIGHT" value="1" enum="Hand">282Right hand.283</constant>284<constant name="HAND_MAX" value="2" enum="Hand">285Maximum value for the hand enum.286</constant>287<constant name="HAND_MOTION_RANGE_UNOBSTRUCTED" value="0" enum="HandMotionRange">288Full hand range, if user closes their hands, we make a full fist.289</constant>290<constant name="HAND_MOTION_RANGE_CONFORM_TO_CONTROLLER" value="1" enum="HandMotionRange">291Conform to controller, if user closes their hands, the tracked data conforms to the shape of the controller.292</constant>293<constant name="HAND_MOTION_RANGE_MAX" value="2" enum="HandMotionRange">294Maximum value for the motion range enum.295</constant>296<constant name="HAND_TRACKED_SOURCE_UNKNOWN" value="0" enum="HandTrackedSource">297The source of hand tracking data is unknown (the extension is likely unsupported).298</constant>299<constant name="HAND_TRACKED_SOURCE_UNOBSTRUCTED" value="1" enum="HandTrackedSource">300The 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.301</constant>302<constant name="HAND_TRACKED_SOURCE_CONTROLLER" value="2" enum="HandTrackedSource">303The source of hand tracking is a controller, bone positions are inferred from controller inputs.304</constant>305<constant name="HAND_TRACKED_SOURCE_MAX" value="3" enum="HandTrackedSource">306Represents the size of the [enum HandTrackedSource] enum.307</constant>308<constant name="HAND_JOINT_PALM" value="0" enum="HandJoints">309Palm joint.310</constant>311<constant name="HAND_JOINT_WRIST" value="1" enum="HandJoints">312Wrist joint.313</constant>314<constant name="HAND_JOINT_THUMB_METACARPAL" value="2" enum="HandJoints">315Thumb metacarpal joint.316</constant>317<constant name="HAND_JOINT_THUMB_PROXIMAL" value="3" enum="HandJoints">318Thumb proximal joint.319</constant>320<constant name="HAND_JOINT_THUMB_DISTAL" value="4" enum="HandJoints">321Thumb distal joint.322</constant>323<constant name="HAND_JOINT_THUMB_TIP" value="5" enum="HandJoints">324Thumb tip joint.325</constant>326<constant name="HAND_JOINT_INDEX_METACARPAL" value="6" enum="HandJoints">327Index finger metacarpal joint.328</constant>329<constant name="HAND_JOINT_INDEX_PROXIMAL" value="7" enum="HandJoints">330Index finger phalanx proximal joint.331</constant>332<constant name="HAND_JOINT_INDEX_INTERMEDIATE" value="8" enum="HandJoints">333Index finger phalanx intermediate joint.334</constant>335<constant name="HAND_JOINT_INDEX_DISTAL" value="9" enum="HandJoints">336Index finger phalanx distal joint.337</constant>338<constant name="HAND_JOINT_INDEX_TIP" value="10" enum="HandJoints">339Index finger tip joint.340</constant>341<constant name="HAND_JOINT_MIDDLE_METACARPAL" value="11" enum="HandJoints">342Middle finger metacarpal joint.343</constant>344<constant name="HAND_JOINT_MIDDLE_PROXIMAL" value="12" enum="HandJoints">345Middle finger phalanx proximal joint.346</constant>347<constant name="HAND_JOINT_MIDDLE_INTERMEDIATE" value="13" enum="HandJoints">348Middle finger phalanx intermediate joint.349</constant>350<constant name="HAND_JOINT_MIDDLE_DISTAL" value="14" enum="HandJoints">351Middle finger phalanx distal joint.352</constant>353<constant name="HAND_JOINT_MIDDLE_TIP" value="15" enum="HandJoints">354Middle finger tip joint.355</constant>356<constant name="HAND_JOINT_RING_METACARPAL" value="16" enum="HandJoints">357Ring finger metacarpal joint.358</constant>359<constant name="HAND_JOINT_RING_PROXIMAL" value="17" enum="HandJoints">360Ring finger phalanx proximal joint.361</constant>362<constant name="HAND_JOINT_RING_INTERMEDIATE" value="18" enum="HandJoints">363Ring finger phalanx intermediate joint.364</constant>365<constant name="HAND_JOINT_RING_DISTAL" value="19" enum="HandJoints">366Ring finger phalanx distal joint.367</constant>368<constant name="HAND_JOINT_RING_TIP" value="20" enum="HandJoints">369Ring finger tip joint.370</constant>371<constant name="HAND_JOINT_LITTLE_METACARPAL" value="21" enum="HandJoints">372Pinky finger metacarpal joint.373</constant>374<constant name="HAND_JOINT_LITTLE_PROXIMAL" value="22" enum="HandJoints">375Pinky finger phalanx proximal joint.376</constant>377<constant name="HAND_JOINT_LITTLE_INTERMEDIATE" value="23" enum="HandJoints">378Pinky finger phalanx intermediate joint.379</constant>380<constant name="HAND_JOINT_LITTLE_DISTAL" value="24" enum="HandJoints">381Pinky finger phalanx distal joint.382</constant>383<constant name="HAND_JOINT_LITTLE_TIP" value="25" enum="HandJoints">384Pinky finger tip joint.385</constant>386<constant name="HAND_JOINT_MAX" value="26" enum="HandJoints">387Represents the size of the [enum HandJoints] enum.388</constant>389<constant name="PERF_SETTINGS_LEVEL_POWER_SAVINGS" value="0" enum="PerfSettingsLevel">390The application has entered a non-XR section (head-locked / static screen), during which power savings are to be prioritized.391</constant>392<constant name="PERF_SETTINGS_LEVEL_SUSTAINED_LOW" value="1" enum="PerfSettingsLevel">393The application has entered a low and stable complexity section, during which reducing power is more important than occasional late rendering frames.394</constant>395<constant name="PERF_SETTINGS_LEVEL_SUSTAINED_HIGH" value="2" enum="PerfSettingsLevel">396The 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.397</constant>398<constant name="PERF_SETTINGS_LEVEL_BOOST" value="3" enum="PerfSettingsLevel">399The application has entered a section with very high complexity, during which the XR Runtime is allowed to step up beyond the thermally sustainable range.400</constant>401<constant name="PERF_SETTINGS_SUB_DOMAIN_COMPOSITING" value="0" enum="PerfSettingsSubDomain">402The compositing performance within the runtime has reached a new level.403</constant>404<constant name="PERF_SETTINGS_SUB_DOMAIN_RENDERING" value="1" enum="PerfSettingsSubDomain">405The application rendering performance has reached a new level.406</constant>407<constant name="PERF_SETTINGS_SUB_DOMAIN_THERMAL" value="2" enum="PerfSettingsSubDomain">408The temperature of the device has reached a new level.409</constant>410<constant name="PERF_SETTINGS_NOTIF_LEVEL_NORMAL" value="0" enum="PerfSettingsNotificationLevel">411The sub-domain has reached a level where no further actions other than currently applied are necessary.412</constant>413<constant name="PERF_SETTINGS_NOTIF_LEVEL_WARNING" value="1" enum="PerfSettingsNotificationLevel">414The sub-domain has reached an early warning level where the application should start proactive mitigation actions.415</constant>416<constant name="PERF_SETTINGS_NOTIF_LEVEL_IMPAIRED" value="2" enum="PerfSettingsNotificationLevel">417The sub-domain has reached a critical level where the application should start drastic mitigation actions.418</constant>419<constant name="HAND_JOINT_NONE" value="0" enum="HandJointFlags" is_bitfield="true">420No flags are set.421</constant>422<constant name="HAND_JOINT_ORIENTATION_VALID" value="1" enum="HandJointFlags" is_bitfield="true">423If set, the orientation data is valid, otherwise, the orientation data is unreliable and should not be used.424</constant>425<constant name="HAND_JOINT_ORIENTATION_TRACKED" value="2" enum="HandJointFlags" is_bitfield="true">426If set, the orientation data comes from tracking data, otherwise, the orientation data contains predicted data.427</constant>428<constant name="HAND_JOINT_POSITION_VALID" value="4" enum="HandJointFlags" is_bitfield="true">429If set, the positional data is valid, otherwise, the positional data is unreliable and should not be used.430</constant>431<constant name="HAND_JOINT_POSITION_TRACKED" value="8" enum="HandJointFlags" is_bitfield="true">432If set, the positional data comes from tracking data, otherwise, the positional data contains predicted data.433</constant>434<constant name="HAND_JOINT_LINEAR_VELOCITY_VALID" value="16" enum="HandJointFlags" is_bitfield="true">435If set, our linear velocity data is valid, otherwise, the linear velocity data is unreliable and should not be used.436</constant>437<constant name="HAND_JOINT_ANGULAR_VELOCITY_VALID" value="32" enum="HandJointFlags" is_bitfield="true">438If set, our angular velocity data is valid, otherwise, the angular velocity data is unreliable and should not be used.439</constant>440</constants>441</class>442443444