Inheritance #

RefCounted

- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
OpenXRAPIExtension

Table of contents

OpenXRAPIExtension #

is_refcounted, is_instantiable, core, not_builtin_classes

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.

Members #

Methods #

func action_get_handle(action: RID) -> int#

Returns the corresponding XrAction OpenXR handle for the given action RID.

func begin_debug_label_region(label_name: String) -> void#

Begins a new debug label region, this label will be reported in debug messages for any calls following this until end_debug_label_region is called. Debug labels can be stacked.

func can_render() -> bool#

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

func end_debug_label_region() -> void#

Marks the end of a debug label region. Removes the latest debug label region added by calling begin_debug_label_region.

func find_action(action_set: RID) -> RID#

Returns the RID corresponding to an Action of a matching name, optionally limited to a specified action set.

func get_error_string(result: int) -> String#

Returns an error string for the given XrResult.

func get_hand_tracker(hand_index: int) -> int#

Returns the corresponding XRHandTrackerEXT handle for the given hand index value.

func get_instance() -> int#

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

func get_instance_proc_addr(name: String) -> int#

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

func get_next_frame_time() -> int#

Returns the predicted display timing for the next frame.

func get_play_space() -> int#

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

func get_predicted_display_time() -> int#

Returns the predicted display timing for the current frame.

func get_projection_layer() -> int#

Returns a pointer to the render state's XrCompositionLayerProjection struct.

Note: This method should only be called from the rendering thread.

func get_render_state_z_far() -> float#

Returns the far boundary value of the camera frustum.

Note: This is only accessible in the render thread.

func get_render_state_z_near() -> float#

Returns the near boundary value of the camera frustum.

Note: This is only accessible in the render thread.

func get_session() -> int#

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

func get_supported_swapchain_formats() -> PackedInt64Array#

Returns an array of supported swapchain formats.

func get_swapchain_format_name(swapchain_format: int) -> String#

Returns the name of the specified swapchain format.

func get_system_id() -> int#

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

func insert_debug_label(label_name: String) -> void#

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.

func is_environment_blend_mode_alpha_supported() -> intOpenXRAPIExtension.OpenXRAlphaBlendModeSupport#

Returns OpenXRAPIExtension.OpenXRAlphaBlendModeSupport denoting if XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND is really supported, emulated or not supported at all.

func is_initialized() -> bool#

Returns true if OpenXR is initialized.

func is_running() -> bool#

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

static func openxr_is_enabled(check_run_in_editor: bool) -> bool#

Returns true if OpenXR is enabled.

func openxr_swapchain_acquire(swapchain: int) -> void#

Acquires the image of the provided swapchain.

func openxr_swapchain_create(array_size: int) -> int#

Returns a pointer to a new swapchain created using the provided parameters.

func openxr_swapchain_free(swapchain: int) -> void#

Destroys the provided swapchain and frees it from memory.

func openxr_swapchain_get_image(swapchain: int) -> RID#

Returns the RID of the provided swapchain's image.

func openxr_swapchain_get_swapchain(swapchain: int) -> int#

Returns the XrSwapchain handle of the provided swapchain.

func openxr_swapchain_release(swapchain: int) -> void#

Releases the image of the provided swapchain.

func register_composition_layer_provider(extension: OpenXRExtensionWrapperExtension) -> void#

Registers the given extension as a composition layer provider.

func register_projection_views_extension(extension: OpenXRExtensionWrapperExtension) -> void#

Registers the given extension as a provider of additional data structures to projections views.

func set_emulate_environment_blend_mode_alpha_blend(enabled: bool) -> void#

If set to true, an OpenXR extension is loaded which is capable of emulating the XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND blend mode.

func set_object_name(object_name: String) -> void#

Set the object name of an OpenXR object, used for debug output. object_type must be a valid OpenXR XrObjectType enum and object_handle must be a valid OpenXR object handle.

func set_render_region(render_region: Rect2i) -> void#

Sets the render region to render_region, overriding the normal render target's rect.

func set_velocity_depth_texture(render_target: RID) -> void#

Sets the render target of the velocity depth texture.

func set_velocity_target_size(target_size: Vector2i) -> void#

Sets the target size of the velocity and velocity depth textures.

func set_velocity_texture(render_target: RID) -> void#

Sets the render target of the velocity texture.

func transform_from_pose(pose: const void*) -> Transform3D#

Creates a Transform3D from an XrPosef.

func unregister_composition_layer_provider(extension: OpenXRExtensionWrapperExtension) -> void#

Unregisters the given extension as a composition layer provider.

func unregister_projection_views_extension(extension: OpenXRExtensionWrapperExtension) -> void#

Unregisters the given extension as a provider of additional data structures to projections views.

func xr_result(args: Array) -> bool#

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.

Annotations #

Constants #

const OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE = 0 enum OpenXRAlphaBlendModeSupport#

Means that XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND isn't supported at all.

const OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL = 1 enum OpenXRAlphaBlendModeSupport#

Means that XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND is really supported.

const OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING = 2 enum OpenXRAlphaBlendModeSupport#

Means that XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND is emulated.

Constructors #

Enums #

OpenXRAlphaBlendModeSupport#

enum OpenXRAlphaBlendModeSupport { OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE = 0, OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL = 1, OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING = 2, }

Operators #

Signals #

Theme Items #

Tutorials #