Debian Codegraph @

modules/openxr/doc_classes/OpenXRInterface.xml

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