OpenXRAPIExtension
Hereda: RefCounted < Object
Hace que la API OpenXR esté disponible para GDExtension.
Descripción
OpenXRAPIExtension makes OpenXR available for GDExtension. It provides the OpenXR API to GDExtension through the get_instance_proc_addr() method, and the OpenXR instance through get_instance().
It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with GDExtension.
Tutoriales
Métodos
Enumeraciones
enum OpenXRAlphaBlendModeSupport: 🔗
OpenXRAlphaBlendModeSupport OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE = 0
Significa que XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND no es compatible en absoluto.
OpenXRAlphaBlendModeSupport OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL = 1
Significa que XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND es realmente compatible.
OpenXRAlphaBlendModeSupport OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING = 2
Significa que XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND es emulado.
Descripciones de Métodos
int action_get_handle(action: RID) 🔗
Returns the corresponding XrAction OpenXR handle for the given action RID.
void begin_debug_label_region(label_name: String) 🔗
Comienza una nueva región de etiqueta de depuración, esta etiqueta se reportará en los mensajes de depuración para cualquier llamada posterior a esta hasta que se llame a end_debug_label_region(). Las etiquetas de depuración se pueden apilar.
Devuelve true si OpenXR está inicializado para renderizar con un viewport XR.
void end_debug_label_region() 🔗
Marks the end of a debug label region. Removes the latest debug label region added by calling begin_debug_label_region().
RID find_action(name: String, action_set: RID) 🔗
Returns the RID corresponding to an Action of a matching name, optionally limited to a specified action set.
String get_error_string(result: int) 🔗
Returns an error string for the given XrResult.
int get_hand_tracker(hand_index: int) 🔗
Returns the corresponding XRHandTrackerEXT handle for the given hand index value.
Returns the XrInstance created during the initialization of the OpenXR API.
int get_instance_proc_addr(name: String) 🔗
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 0.
Note: openxr/util.h contains utility macros for acquiring OpenXR functions, e.g. GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction).
Returns the predicted display timing for the next frame.
Returns the version of OpenXR that was initialized. Only valid after the OpenXR instance has been created. See XR_MAKE_VERSION for how the version is calculated.
Returns the play space, which is an XrSpace cast to an integer.
int get_predicted_display_time() 🔗
Returns the predicted display timing for the current frame.
Returns a pointer to the render state's XrCompositionLayerProjection struct.
Note: This method should only be called from the rendering thread.
float get_render_state_z_far() 🔗
Returns the far boundary value of the camera frustum.
Note: This is only accessible in the render thread.
float get_render_state_z_near() 🔗
Returns the near boundary value of the camera frustum.
Note: This is only accessible in the render thread.
Returns the OpenXR session, which is an XrSession cast to an integer.
PackedInt64Array get_supported_swapchain_formats() 🔗
Returns an array of supported swapchain formats.
String get_swapchain_format_name(swapchain_format: int) 🔗
Returns the name of the specified swapchain format.
Returns the ID of the system, which is an XrSystemId cast to an integer.
void insert_debug_label(label_name: String) 🔗
Inserts a debug label, this label is reported in any debug message resulting from the OpenXR calls that follows, until any of begin_debug_label_region(), end_debug_label_region(), or insert_debug_label() is called.
OpenXRAlphaBlendModeSupport is_environment_blend_mode_alpha_supported() 🔗
Returns OpenXRAlphaBlendModeSupport denoting if XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND is really supported, emulated or not supported at all.
Returns true if OpenXR is initialized.
Returns true if OpenXR is running (xrBeginSession was successfully called and the swapchains were created).
bool openxr_is_enabled(check_run_in_editor: bool) static 🔗
Returns true if OpenXR is enabled.
void openxr_swapchain_acquire(swapchain: int) 🔗
Acquires the image of the provided swapchain.
int openxr_swapchain_create(create_flags: int, usage_flags: int, swapchain_format: int, width: int, height: int, sample_count: int, array_size: int) 🔗
Returns a pointer to a new swapchain created using the provided parameters.
void openxr_swapchain_free(swapchain: int) 🔗
Destruye la cadena de intercambio proporcionada y la libera de la memoria.
RID openxr_swapchain_get_image(swapchain: int) 🔗
Returns the RID of the provided swapchain's image.
int openxr_swapchain_get_swapchain(swapchain: int) 🔗
Returns the XrSwapchain handle of the provided swapchain.
void openxr_swapchain_release(swapchain: int) 🔗
Releases the image of the provided swapchain.
void register_composition_layer_provider(extension: OpenXRExtensionWrapper) 🔗
Registers the given extension as a composition layer provider.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._on_session_created().
void register_frame_info_extension(extension: OpenXRExtensionWrapper) 🔗
Registers the given extension as modifying frame info via the OpenXRExtensionWrapper._set_frame_wait_info_and_get_next_pointer(), OpenXRExtensionWrapper._set_view_locate_info_and_get_next_pointer(), or OpenXRExtensionWrapper._set_frame_end_info_and_get_next_pointer() virtual methods.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._on_session_created().
void register_projection_views_extension(extension: OpenXRExtensionWrapper) 🔗
Registers the given extension as a provider of additional data structures to projections views.
Note: This cannot be called after the OpenXR session has started. However, it can be called in OpenXRExtensionWrapper._on_session_created().
void set_custom_play_space(space: const void*) 🔗
Establece el espacio de referencia utilizado por OpenXR al XrSpace dado (convertido a un void *).
void set_emulate_environment_blend_mode_alpha_blend(enabled: bool) 🔗
Si se establece en true, se carga una extensión de OpenXR que es capaz de emular el modo de mezcla XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND.
void set_object_name(object_type: int, object_handle: int, object_name: String) 🔗
Establece el nombre del objeto de un objeto OpenXR, utilizado para la salida de depuración. object_type debe ser un enum XrObjectType válido de OpenXR y object_handle debe ser un identificador de objeto válido de OpenXR.
void set_render_region(render_region: Rect2i) 🔗
Sets the render region to render_region, overriding the normal render target's rect.
void set_velocity_depth_texture(render_target: RID) 🔗
Sets the render target of the velocity depth texture.
void set_velocity_target_size(target_size: Vector2i) 🔗
Sets the target size of the velocity and velocity depth textures.
void set_velocity_texture(render_target: RID) 🔗
Sets the render target of the velocity texture.
Transform3D transform_from_pose(pose: const void*) 🔗
Creates a Transform3D from an XrPosef.
void unregister_composition_layer_provider(extension: OpenXRExtensionWrapper) 🔗
Unregisters the given extension as a composition layer provider.
Note: This cannot be called while the OpenXR session is still running.
void unregister_frame_info_extension(extension: OpenXRExtensionWrapper) 🔗
Unregisters the given extension as modifying frame info.
Note: This cannot be called while the OpenXR session is still running.
void unregister_projection_views_extension(extension: OpenXRExtensionWrapper) 🔗
Unregisters the given extension as a provider of additional data structures to projections views.
Note: This cannot be called while the OpenXR session is still running.
void update_main_swapchain_size() 🔗
Request the recommended resolution from the OpenXR runtime and update the main swapchain size if it has changed.
bool xr_result(result: int, format: String, args: Array) 🔗
Returns true if the provided XrResult (cast to an integer) is successful. Otherwise returns false and prints the XrResult converted to a string, with the specified additional information.