Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/modules/openxr/doc_classes/OpenXRAPIExtension.xml
10278 views
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<class name="OpenXRAPIExtension" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
3
<brief_description>
4
Makes the OpenXR API available for GDExtension.
5
</brief_description>
6
<description>
7
[OpenXRAPIExtension] makes OpenXR available for GDExtension. It provides the OpenXR API to GDExtension through the [method get_instance_proc_addr] method, and the OpenXR instance through [method get_instance].
8
It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with GDExtension.
9
</description>
10
<tutorials>
11
<link title="XrResult documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html</link>
12
<link title="XrInstance documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html</link>
13
<link title="XrSpace documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html</link>
14
<link title="XrSession documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html</link>
15
<link title="XrSystemId documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html</link>
16
<link title="xrBeginSession documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html</link>
17
<link title="XrPosef documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html</link>
18
</tutorials>
19
<methods>
20
<method name="action_get_handle">
21
<return type="int" />
22
<param index="0" name="action" type="RID" />
23
<description>
24
Returns the corresponding [code]XrAction[/code] OpenXR handle for the given action RID.
25
</description>
26
</method>
27
<method name="begin_debug_label_region">
28
<return type="void" />
29
<param index="0" name="label_name" type="String" />
30
<description>
31
Begins a new debug label region, this label will be reported in debug messages for any calls following this until [method end_debug_label_region] is called. Debug labels can be stacked.
32
</description>
33
</method>
34
<method name="can_render">
35
<return type="bool" />
36
<description>
37
Returns [code]true[/code] if OpenXR is initialized for rendering with an XR viewport.
38
</description>
39
</method>
40
<method name="end_debug_label_region">
41
<return type="void" />
42
<description>
43
Marks the end of a debug label region. Removes the latest debug label region added by calling [method begin_debug_label_region].
44
</description>
45
</method>
46
<method name="find_action">
47
<return type="RID" />
48
<param index="0" name="name" type="String" />
49
<param index="1" name="action_set" type="RID" />
50
<description>
51
Returns the [RID] corresponding to an [code]Action[/code] of a matching name, optionally limited to a specified action set.
52
</description>
53
</method>
54
<method name="get_error_string">
55
<return type="String" />
56
<param index="0" name="result" type="int" />
57
<description>
58
Returns an error string for the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url].
59
</description>
60
</method>
61
<method name="get_hand_tracker">
62
<return type="int" />
63
<param index="0" name="hand_index" type="int" />
64
<description>
65
Returns the corresponding [code]XRHandTrackerEXT[/code] handle for the given hand index value.
66
</description>
67
</method>
68
<method name="get_instance">
69
<return type="int" />
70
<description>
71
Returns the [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html]XrInstance[/url] created during the initialization of the OpenXR API.
72
</description>
73
</method>
74
<method name="get_instance_proc_addr">
75
<return type="int" />
76
<param index="0" name="name" type="String" />
77
<description>
78
Returns the function pointer of the OpenXR function with the specified name, cast to an integer. If the function with the given name does not exist, the method returns [code]0[/code].
79
[b]Note:[/b] [code]openxr/util.h[/code] contains utility macros for acquiring OpenXR functions, e.g. [code]GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)[/code].
80
</description>
81
</method>
82
<method name="get_next_frame_time">
83
<return type="int" />
84
<description>
85
Returns the predicted display timing for the next frame.
86
</description>
87
</method>
88
<method name="get_play_space">
89
<return type="int" />
90
<description>
91
Returns the play space, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html]XrSpace[/url] cast to an integer.
92
</description>
93
</method>
94
<method name="get_predicted_display_time">
95
<return type="int" />
96
<description>
97
Returns the predicted display timing for the current frame.
98
</description>
99
</method>
100
<method name="get_projection_layer">
101
<return type="int" />
102
<description>
103
Returns a pointer to the render state's [code]XrCompositionLayerProjection[/code] struct.
104
[b]Note:[/b] This method should only be called from the rendering thread.
105
</description>
106
</method>
107
<method name="get_render_state_z_far">
108
<return type="float" />
109
<description>
110
Returns the far boundary value of the camera frustum.
111
[b]Note:[/b] This is only accessible in the render thread.
112
</description>
113
</method>
114
<method name="get_render_state_z_near">
115
<return type="float" />
116
<description>
117
Returns the near boundary value of the camera frustum.
118
[b]Note:[/b] This is only accessible in the render thread.
119
</description>
120
</method>
121
<method name="get_session">
122
<return type="int" />
123
<description>
124
Returns the OpenXR session, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html]XrSession[/url] cast to an integer.
125
</description>
126
</method>
127
<method name="get_supported_swapchain_formats">
128
<return type="PackedInt64Array" />
129
<description>
130
Returns an array of supported swapchain formats.
131
</description>
132
</method>
133
<method name="get_swapchain_format_name">
134
<return type="String" />
135
<param index="0" name="swapchain_format" type="int" />
136
<description>
137
Returns the name of the specified swapchain format.
138
</description>
139
</method>
140
<method name="get_system_id">
141
<return type="int" />
142
<description>
143
Returns the id of the system, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html]XrSystemId[/url] cast to an integer.
144
</description>
145
</method>
146
<method name="insert_debug_label">
147
<return type="void" />
148
<param index="0" name="label_name" type="String" />
149
<description>
150
Inserts a debug label, this label is reported in any debug message resulting from the OpenXR calls that follows, until any of [method begin_debug_label_region], [method end_debug_label_region], or [method insert_debug_label] is called.
151
</description>
152
</method>
153
<method name="is_environment_blend_mode_alpha_supported">
154
<return type="int" enum="OpenXRAPIExtension.OpenXRAlphaBlendModeSupport" />
155
<description>
156
Returns [enum OpenXRAPIExtension.OpenXRAlphaBlendModeSupport] denoting if [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported, emulated or not supported at all.
157
</description>
158
</method>
159
<method name="is_initialized">
160
<return type="bool" />
161
<description>
162
Returns [code]true[/code] if OpenXR is initialized.
163
</description>
164
</method>
165
<method name="is_running">
166
<return type="bool" />
167
<description>
168
Returns [code]true[/code] if OpenXR is running ([url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html]xrBeginSession[/url] was successfully called and the swapchains were created).
169
</description>
170
</method>
171
<method name="openxr_is_enabled" qualifiers="static">
172
<return type="bool" />
173
<param index="0" name="check_run_in_editor" type="bool" />
174
<description>
175
Returns [code]true[/code] if OpenXR is enabled.
176
</description>
177
</method>
178
<method name="openxr_swapchain_acquire">
179
<return type="void" />
180
<param index="0" name="swapchain" type="int" />
181
<description>
182
Acquires the image of the provided swapchain.
183
</description>
184
</method>
185
<method name="openxr_swapchain_create">
186
<return type="int" />
187
<param index="0" name="create_flags" type="int" />
188
<param index="1" name="usage_flags" type="int" />
189
<param index="2" name="swapchain_format" type="int" />
190
<param index="3" name="width" type="int" />
191
<param index="4" name="height" type="int" />
192
<param index="5" name="sample_count" type="int" />
193
<param index="6" name="array_size" type="int" />
194
<description>
195
Returns a pointer to a new swapchain created using the provided parameters.
196
</description>
197
</method>
198
<method name="openxr_swapchain_free">
199
<return type="void" />
200
<param index="0" name="swapchain" type="int" />
201
<description>
202
Destroys the provided swapchain and frees it from memory.
203
</description>
204
</method>
205
<method name="openxr_swapchain_get_image">
206
<return type="RID" />
207
<param index="0" name="swapchain" type="int" />
208
<description>
209
Returns the RID of the provided swapchain's image.
210
</description>
211
</method>
212
<method name="openxr_swapchain_get_swapchain">
213
<return type="int" />
214
<param index="0" name="swapchain" type="int" />
215
<description>
216
Returns the [code]XrSwapchain[/code] handle of the provided swapchain.
217
</description>
218
</method>
219
<method name="openxr_swapchain_release">
220
<return type="void" />
221
<param index="0" name="swapchain" type="int" />
222
<description>
223
Releases the image of the provided swapchain.
224
</description>
225
</method>
226
<method name="register_composition_layer_provider">
227
<return type="void" />
228
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
229
<description>
230
Registers the given extension as a composition layer provider.
231
</description>
232
</method>
233
<method name="register_frame_info_extension">
234
<return type="void" />
235
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
236
<description>
237
Registers the given extension as modifying frame info via the [method OpenXRExtensionWrapper._set_frame_wait_info_and_get_next_pointer], [method OpenXRExtensionWrapper._set_view_locate_info_and_get_next_pointer], or [method OpenXRExtensionWrapper._set_frame_end_info_and_get_next_pointer] virtual methods.
238
</description>
239
</method>
240
<method name="register_projection_views_extension">
241
<return type="void" />
242
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
243
<description>
244
Registers the given extension as a provider of additional data structures to projections views.
245
</description>
246
</method>
247
<method name="set_custom_play_space">
248
<return type="void" />
249
<param index="0" name="space" type="const void*" />
250
<description>
251
Sets the reference space used by OpenXR to the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html]XrSpace[/url] (cast to a [code]void *[/code]).
252
</description>
253
</method>
254
<method name="set_emulate_environment_blend_mode_alpha_blend">
255
<return type="void" />
256
<param index="0" name="enabled" type="bool" />
257
<description>
258
If set to [code]true[/code], an OpenXR extension is loaded which is capable of emulating the [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] blend mode.
259
</description>
260
</method>
261
<method name="set_object_name">
262
<return type="void" />
263
<param index="0" name="object_type" type="int" />
264
<param index="1" name="object_handle" type="int" />
265
<param index="2" name="object_name" type="String" />
266
<description>
267
Set the object name of an OpenXR object, used for debug output. [param object_type] must be a valid OpenXR [code]XrObjectType[/code] enum and [param object_handle] must be a valid OpenXR object handle.
268
</description>
269
</method>
270
<method name="set_render_region">
271
<return type="void" />
272
<param index="0" name="render_region" type="Rect2i" />
273
<description>
274
Sets the render region to [param render_region], overriding the normal render target's rect.
275
</description>
276
</method>
277
<method name="set_velocity_depth_texture">
278
<return type="void" />
279
<param index="0" name="render_target" type="RID" />
280
<description>
281
Sets the render target of the velocity depth texture.
282
</description>
283
</method>
284
<method name="set_velocity_target_size">
285
<return type="void" />
286
<param index="0" name="target_size" type="Vector2i" />
287
<description>
288
Sets the target size of the velocity and velocity depth textures.
289
</description>
290
</method>
291
<method name="set_velocity_texture">
292
<return type="void" />
293
<param index="0" name="render_target" type="RID" />
294
<description>
295
Sets the render target of the velocity texture.
296
</description>
297
</method>
298
<method name="transform_from_pose">
299
<return type="Transform3D" />
300
<param index="0" name="pose" type="const void*" />
301
<description>
302
Creates a [Transform3D] from an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html]XrPosef[/url].
303
</description>
304
</method>
305
<method name="unregister_composition_layer_provider">
306
<return type="void" />
307
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
308
<description>
309
Unregisters the given extension as a composition layer provider.
310
</description>
311
</method>
312
<method name="unregister_frame_info_extension">
313
<return type="void" />
314
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
315
<description>
316
Unregisters the given extension as modifying frame info.
317
</description>
318
</method>
319
<method name="unregister_projection_views_extension">
320
<return type="void" />
321
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
322
<description>
323
Unregisters the given extension as a provider of additional data structures to projections views.
324
</description>
325
</method>
326
<method name="xr_result">
327
<return type="bool" />
328
<param index="0" name="result" type="int" />
329
<param index="1" name="format" type="String" />
330
<param index="2" name="args" type="Array" />
331
<description>
332
Returns [code]true[/code] if the provided [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] (cast to an integer) is successful. Otherwise returns [code]false[/code] and prints the [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] converted to a string, with the specified additional information.
333
</description>
334
</method>
335
</methods>
336
<constants>
337
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE" value="0" enum="OpenXRAlphaBlendModeSupport">
338
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] isn't supported at all.
339
</constant>
340
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL" value="1" enum="OpenXRAlphaBlendModeSupport">
341
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported.
342
</constant>
343
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING" value="2" enum="OpenXRAlphaBlendModeSupport">
344
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is emulated.
345
</constant>
346
</constants>
347
</class>
348
349