Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

OpenXRAPIExtension

Inherits: RefCounted < Object

Makes the OpenXR API available for GDExtension.

描述

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.

教程

Methods

bool

can_render ( )

String

get_error_string ( int result )

int

get_instance ( )

int

get_instance_proc_addr ( String name )

int

get_next_frame_time ( )

int

get_play_space ( )

int

get_session ( )

String

get_swapchain_format_name ( int swapchain_format )

int

get_system_id ( )

bool

is_initialized ( )

bool

is_running ( )

bool

openxr_is_enabled ( bool check_run_in_editor ) static

Transform3D

transform_from_pose ( const void* pose )

bool

xr_result ( int result, String format, Array args )


Method Descriptions

bool can_render ( )

Returns true if OpenXR is initialized for rendering with an XR viewport.


String get_error_string ( int result )

Returns an error string for the given XrResult.


int get_instance ( )

Returns the XrInstance created during the initialization of the OpenXR API.


int get_instance_proc_addr ( String name )

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).


int get_next_frame_time ( )

Returns the timing for the next frame.


int get_play_space ( )

Returns the play space, which is an XrSpace cast to an integer.


int get_session ( )

Returns the OpenXR session, which is an XrSession cast to an integer.


String get_swapchain_format_name ( int swapchain_format )

Returns the name of the specified swapchain format.


int get_system_id ( )

Returns the id of the system, which is a XrSystemId cast to an integer.


bool is_initialized ( )

Returns true if OpenXR is initialized.


bool is_running ( )

Returns true if OpenXR is running (xrBeginSession was successfully called and the swapchains were created).


bool openxr_is_enabled ( bool check_run_in_editor ) static

Returns true if OpenXR is enabled.


Transform3D transform_from_pose ( const void* pose )

Creates a Transform3D from an XrPosef.


bool xr_result ( int result, String format, Array args )

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.