Path: blob/master/modules/openxr/doc_classes/OpenXRInterface.xml
20897 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 a list of 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] When using the Vulkan rendering driver, [member Viewport.vrs_mode] must be set to [constant Viewport.VRS_XR] to support foveation.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="is_user_presence_supported" qualifiers="const">129<return type="bool" />130<description>131Returns [code]true[/code] if OpenXR's user presence extension is supported and enabled.132[b]Note:[/b] This only returns a valid value after OpenXR has been initialized.133</description>134</method>135<method name="is_user_present" qualifiers="const">136<return type="bool" />137<description>138Returns [code]true[/code] if system has detected the presence of a user in the XR experience.139</description>140</method>141<method name="set_action_set_active">142<return type="void" />143<param index="0" name="name" type="String" />144<param index="1" name="active" type="bool" />145<description>146Sets the given action set as active or inactive.147</description>148</method>149<method name="set_cpu_level">150<return type="void" />151<param index="0" name="level" type="int" enum="OpenXRInterface.PerfSettingsLevel" />152<description>153Sets the CPU performance level of the OpenXR device.154</description>155</method>156<method name="set_gpu_level">157<return type="void" />158<param index="0" name="level" type="int" enum="OpenXRInterface.PerfSettingsLevel" />159<description>160Sets the GPU performance level of the OpenXR device.161</description>162</method>163<method name="set_motion_range">164<return type="void" />165<param index="0" name="hand" type="int" enum="OpenXRInterface.Hand" />166<param index="1" name="motion_range" type="int" enum="OpenXRInterface.HandMotionRange" />167<description>168If handtracking is enabled and motion range is supported, sets the currently configured motion range for [param hand] to [param motion_range].169</description>170</method>171</methods>172<members>173<member name="display_refresh_rate" type="float" setter="set_display_refresh_rate" getter="get_display_refresh_rate" default="0.0">174The 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.175</member>176<member name="foveation_dynamic" type="bool" setter="set_foveation_dynamic" getter="get_foveation_dynamic" default="false">177If [code]true[/code], enables dynamic foveation adjustment. The interface must be initialized before this is accessible. If enabled, foveation will automatically be adjusted between low and [member foveation_level].178[b]Note:[/b] Only works on the Compatibility renderer.179</member>180<member name="foveation_level" type="int" setter="set_foveation_level" getter="get_foveation_level" default="0">181The foveation level, from [code]0[/code] (off) to [code]3[/code] (high). The interface must be initialized before this is accessible.182[b]Note:[/b] Only works on the Compatibility renderer.183</member>184<member name="render_target_size_multiplier" type="float" setter="set_render_target_size_multiplier" getter="get_render_target_size_multiplier" default="1.0">185The render size multiplier for the current HMD. Must be set before the interface has been initialized.186</member>187<member name="vrs_min_radius" type="float" setter="set_vrs_min_radius" getter="get_vrs_min_radius" default="20.0">188The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size.189[b]Note:[/b] Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR].190</member>191<member name="vrs_strength" type="float" setter="set_vrs_strength" getter="get_vrs_strength" default="1.0">192The 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.193[b]Note:[/b] Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR].194</member>195</members>196<signals>197<signal name="cpu_level_changed">198<param index="0" name="sub_domain" type="int" />199<param index="1" name="from_level" type="int" />200<param index="2" name="to_level" type="int" />201<description>202Informs the device CPU performance level has changed in the specified subdomain.203</description>204</signal>205<signal name="gpu_level_changed">206<param index="0" name="sub_domain" type="int" />207<param index="1" name="from_level" type="int" />208<param index="2" name="to_level" type="int" />209<description>210Informs the device GPU performance level has changed in the specified subdomain.211</description>212</signal>213<signal name="instance_exiting">214<description>215Informs our OpenXR instance is exiting.216</description>217</signal>218<signal name="pose_recentered">219<description>220Informs the user queued a recenter of the player position.221</description>222</signal>223<signal name="refresh_rate_changed">224<param index="0" name="refresh_rate" type="float" />225<description>226Informs the user the HMD refresh rate has changed.227[b]Note:[/b] Only emitted if XR runtime supports the refresh rate extension.228</description>229</signal>230<signal name="session_begun">231<description>232Informs our OpenXR session has been started.233</description>234</signal>235<signal name="session_focussed">236<description>237Informs our OpenXR session now has focus, for example output is sent to the HMD and we're receiving XR input.238</description>239</signal>240<signal name="session_loss_pending">241<description>242Informs our OpenXR session is in the process of being lost.243</description>244</signal>245<signal name="session_stopping">246<description>247Informs our OpenXR session is stopping.248</description>249</signal>250<signal name="session_synchronized">251<description>252Informs our OpenXR session has been synchronized.253</description>254</signal>255<signal name="session_visible">256<description>257Informs our OpenXR session is now visible, for example output is sent to the HMD but we don't receive XR input.258</description>259</signal>260<signal name="user_presence_changed">261<param index="0" name="is_user_present" type="bool" />262<description>263Signal emitted when the user presence value changes.264[b]Note:[/b] This signal will not be emitted during application startup and application shutdown. Developers should assume user presence is gained on startup and lost on shutdown.265</description>266</signal>267</signals>268<constants>269<constant name="SESSION_STATE_UNKNOWN" value="0" enum="SessionState">270The state of the session is unknown, we haven't tried setting up OpenXR yet.271</constant>272<constant name="SESSION_STATE_IDLE" value="1" enum="SessionState">273The initial state after the OpenXR session is created or after the session is destroyed.274</constant>275<constant name="SESSION_STATE_READY" value="2" enum="SessionState">276OpenXR is ready to begin our session. [signal session_begun] is emitted when we change to this state.277</constant>278<constant name="SESSION_STATE_SYNCHRONIZED" value="3" enum="SessionState">279The 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.280</constant>281<constant name="SESSION_STATE_VISIBLE" value="4" enum="SessionState">282The 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.283[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.284</constant>285<constant name="SESSION_STATE_FOCUSED" value="5" enum="SessionState">286The 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.287[b]Note:[/b] This is the state OpenXR will be in when the user can fully interact with your game.288</constant>289<constant name="SESSION_STATE_STOPPING" value="6" enum="SessionState">290Our session is being stopped. [signal session_stopping] is emitted when we change to this state.291</constant>292<constant name="SESSION_STATE_LOSS_PENDING" value="7" enum="SessionState">293The session is about to be lost. [signal session_loss_pending] is emitted when we change to this state.294</constant>295<constant name="SESSION_STATE_EXITING" value="8" enum="SessionState">296The OpenXR instance is about to be destroyed and we're exiting. [signal instance_exiting] is emitted when we change to this state.297</constant>298<constant name="HAND_LEFT" value="0" enum="Hand">299Left hand.300</constant>301<constant name="HAND_RIGHT" value="1" enum="Hand">302Right hand.303</constant>304<constant name="HAND_MAX" value="2" enum="Hand">305Maximum value for the hand enum.306</constant>307<constant name="HAND_MOTION_RANGE_UNOBSTRUCTED" value="0" enum="HandMotionRange">308Full hand range, if user closes their hands, we make a full fist.309</constant>310<constant name="HAND_MOTION_RANGE_CONFORM_TO_CONTROLLER" value="1" enum="HandMotionRange">311Conform to controller, if user closes their hands, the tracked data conforms to the shape of the controller.312</constant>313<constant name="HAND_MOTION_RANGE_MAX" value="2" enum="HandMotionRange">314Maximum value for the motion range enum.315</constant>316<constant name="HAND_TRACKED_SOURCE_UNKNOWN" value="0" enum="HandTrackedSource">317The source of hand tracking data is unknown (the extension is likely unsupported).318</constant>319<constant name="HAND_TRACKED_SOURCE_UNOBSTRUCTED" value="1" enum="HandTrackedSource">320The 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.321</constant>322<constant name="HAND_TRACKED_SOURCE_CONTROLLER" value="2" enum="HandTrackedSource">323The source of hand tracking is a controller, bone positions are inferred from controller inputs.324</constant>325<constant name="HAND_TRACKED_SOURCE_MAX" value="3" enum="HandTrackedSource">326Represents the size of the [enum HandTrackedSource] enum.327</constant>328<constant name="HAND_JOINT_PALM" value="0" enum="HandJoints">329Palm joint.330</constant>331<constant name="HAND_JOINT_WRIST" value="1" enum="HandJoints">332Wrist joint.333</constant>334<constant name="HAND_JOINT_THUMB_METACARPAL" value="2" enum="HandJoints">335Thumb metacarpal joint.336</constant>337<constant name="HAND_JOINT_THUMB_PROXIMAL" value="3" enum="HandJoints">338Thumb proximal joint.339</constant>340<constant name="HAND_JOINT_THUMB_DISTAL" value="4" enum="HandJoints">341Thumb distal joint.342</constant>343<constant name="HAND_JOINT_THUMB_TIP" value="5" enum="HandJoints">344Thumb tip joint.345</constant>346<constant name="HAND_JOINT_INDEX_METACARPAL" value="6" enum="HandJoints">347Index finger metacarpal joint.348</constant>349<constant name="HAND_JOINT_INDEX_PROXIMAL" value="7" enum="HandJoints">350Index finger phalanx proximal joint.351</constant>352<constant name="HAND_JOINT_INDEX_INTERMEDIATE" value="8" enum="HandJoints">353Index finger phalanx intermediate joint.354</constant>355<constant name="HAND_JOINT_INDEX_DISTAL" value="9" enum="HandJoints">356Index finger phalanx distal joint.357</constant>358<constant name="HAND_JOINT_INDEX_TIP" value="10" enum="HandJoints">359Index finger tip joint.360</constant>361<constant name="HAND_JOINT_MIDDLE_METACARPAL" value="11" enum="HandJoints">362Middle finger metacarpal joint.363</constant>364<constant name="HAND_JOINT_MIDDLE_PROXIMAL" value="12" enum="HandJoints">365Middle finger phalanx proximal joint.366</constant>367<constant name="HAND_JOINT_MIDDLE_INTERMEDIATE" value="13" enum="HandJoints">368Middle finger phalanx intermediate joint.369</constant>370<constant name="HAND_JOINT_MIDDLE_DISTAL" value="14" enum="HandJoints">371Middle finger phalanx distal joint.372</constant>373<constant name="HAND_JOINT_MIDDLE_TIP" value="15" enum="HandJoints">374Middle finger tip joint.375</constant>376<constant name="HAND_JOINT_RING_METACARPAL" value="16" enum="HandJoints">377Ring finger metacarpal joint.378</constant>379<constant name="HAND_JOINT_RING_PROXIMAL" value="17" enum="HandJoints">380Ring finger phalanx proximal joint.381</constant>382<constant name="HAND_JOINT_RING_INTERMEDIATE" value="18" enum="HandJoints">383Ring finger phalanx intermediate joint.384</constant>385<constant name="HAND_JOINT_RING_DISTAL" value="19" enum="HandJoints">386Ring finger phalanx distal joint.387</constant>388<constant name="HAND_JOINT_RING_TIP" value="20" enum="HandJoints">389Ring finger tip joint.390</constant>391<constant name="HAND_JOINT_LITTLE_METACARPAL" value="21" enum="HandJoints">392Pinky finger metacarpal joint.393</constant>394<constant name="HAND_JOINT_LITTLE_PROXIMAL" value="22" enum="HandJoints">395Pinky finger phalanx proximal joint.396</constant>397<constant name="HAND_JOINT_LITTLE_INTERMEDIATE" value="23" enum="HandJoints">398Pinky finger phalanx intermediate joint.399</constant>400<constant name="HAND_JOINT_LITTLE_DISTAL" value="24" enum="HandJoints">401Pinky finger phalanx distal joint.402</constant>403<constant name="HAND_JOINT_LITTLE_TIP" value="25" enum="HandJoints">404Pinky finger tip joint.405</constant>406<constant name="HAND_JOINT_MAX" value="26" enum="HandJoints">407Represents the size of the [enum HandJoints] enum.408</constant>409<constant name="PERF_SETTINGS_LEVEL_POWER_SAVINGS" value="0" enum="PerfSettingsLevel">410The application has entered a non-XR section (head-locked / static screen), during which power savings are to be prioritized.411</constant>412<constant name="PERF_SETTINGS_LEVEL_SUSTAINED_LOW" value="1" enum="PerfSettingsLevel">413The application has entered a low and stable complexity section, during which reducing power is more important than occasional late rendering frames.414</constant>415<constant name="PERF_SETTINGS_LEVEL_SUSTAINED_HIGH" value="2" enum="PerfSettingsLevel">416The 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.417</constant>418<constant name="PERF_SETTINGS_LEVEL_BOOST" value="3" enum="PerfSettingsLevel">419The application has entered a section with very high complexity, during which the XR Runtime is allowed to step up beyond the thermally sustainable range.420</constant>421<constant name="PERF_SETTINGS_SUB_DOMAIN_COMPOSITING" value="0" enum="PerfSettingsSubDomain">422The compositing performance within the runtime has reached a new level.423</constant>424<constant name="PERF_SETTINGS_SUB_DOMAIN_RENDERING" value="1" enum="PerfSettingsSubDomain">425The application rendering performance has reached a new level.426</constant>427<constant name="PERF_SETTINGS_SUB_DOMAIN_THERMAL" value="2" enum="PerfSettingsSubDomain">428The temperature of the device has reached a new level.429</constant>430<constant name="PERF_SETTINGS_NOTIF_LEVEL_NORMAL" value="0" enum="PerfSettingsNotificationLevel">431The sub-domain has reached a level where no further actions other than currently applied are necessary.432</constant>433<constant name="PERF_SETTINGS_NOTIF_LEVEL_WARNING" value="1" enum="PerfSettingsNotificationLevel">434The sub-domain has reached an early warning level where the application should start proactive mitigation actions.435</constant>436<constant name="PERF_SETTINGS_NOTIF_LEVEL_IMPAIRED" value="2" enum="PerfSettingsNotificationLevel">437The sub-domain has reached a critical level where the application should start drastic mitigation actions.438</constant>439<constant name="HAND_JOINT_NONE" value="0" enum="HandJointFlags" is_bitfield="true">440No flags are set.441</constant>442<constant name="HAND_JOINT_ORIENTATION_VALID" value="1" enum="HandJointFlags" is_bitfield="true">443If set, the orientation data is valid, otherwise, the orientation data is unreliable and should not be used.444</constant>445<constant name="HAND_JOINT_ORIENTATION_TRACKED" value="2" enum="HandJointFlags" is_bitfield="true">446If set, the orientation data comes from tracking data, otherwise, the orientation data contains predicted data.447</constant>448<constant name="HAND_JOINT_POSITION_VALID" value="4" enum="HandJointFlags" is_bitfield="true">449If set, the positional data is valid, otherwise, the positional data is unreliable and should not be used.450</constant>451<constant name="HAND_JOINT_POSITION_TRACKED" value="8" enum="HandJointFlags" is_bitfield="true">452If set, the positional data comes from tracking data, otherwise, the positional data contains predicted data.453</constant>454<constant name="HAND_JOINT_LINEAR_VELOCITY_VALID" value="16" enum="HandJointFlags" is_bitfield="true">455If set, our linear velocity data is valid, otherwise, the linear velocity data is unreliable and should not be used.456</constant>457<constant name="HAND_JOINT_ANGULAR_VELOCITY_VALID" value="32" enum="HandJointFlags" is_bitfield="true">458If set, our angular velocity data is valid, otherwise, the angular velocity data is unreliable and should not be used.459</constant>460</constants>461</class>462463464