Table of Contents

Class OpenXRExtensionWrapperExtension

Namespace
Godot
Assembly
GodotSharp.dll

OpenXRExtensionWrapperExtension allows clients to implement OpenXR extensions with GDExtension. The extension should be registered with RegisterExtensionWrapper().

public class OpenXRExtensionWrapperExtension : GodotObject, IDisposable
Inheritance
OpenXRExtensionWrapperExtension
Implements
Inherited Members

Constructors

OpenXRExtensionWrapperExtension()

public OpenXRExtensionWrapperExtension()

Methods

GetOpenxrApi()

Returns the created OpenXRApiExtension, which can be used to access the OpenXR API.

public OpenXRApiExtension GetOpenxrApi()

Returns

OpenXRApiExtension

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

RegisterExtensionWrapper()

Registers the extension. This should happen at core module initialization level.

public void RegisterExtensionWrapper()

_GetCompositionLayer(int)

Returns a pointer to an XrCompositionLayerBaseHeader struct to provide the given composition layer.

This will only be called if the extension previously registered itself with RegisterCompositionLayerProvider(OpenXRExtensionWrapperExtension).

public virtual ulong _GetCompositionLayer(int index)

Parameters

index int

Returns

ulong

_GetCompositionLayerCount()

Returns the number of composition layers this extension wrapper provides via _GetCompositionLayer(int).

This will only be called if the extension previously registered itself with RegisterCompositionLayerProvider(OpenXRExtensionWrapperExtension).

public virtual int _GetCompositionLayerCount()

Returns

int

_GetCompositionLayerOrder(int)

Returns an integer that will be used to sort the given composition layer provided via _GetCompositionLayer(int). Lower numbers will move the layer to the front of the list, and higher numbers to the end. The default projection layer has an order of 0, so layers provided by this method should probably be above or below (but not exactly) 0.

This will only be called if the extension previously registered itself with RegisterCompositionLayerProvider(OpenXRExtensionWrapperExtension).

public virtual int _GetCompositionLayerOrder(int index)

Parameters

index int

Returns

int

_GetRequestedExtensions()

Returns a Dictionary of OpenXR extensions related to this extension. The Dictionary should contain the name of the extension, mapped to a bool * cast to an integer:

- If the bool * is a nullptr this extension is mandatory.

- If the bool * points to a boolean, the boolean will be updated to true if the extension is enabled.

public virtual Dictionary _GetRequestedExtensions()

Returns

Dictionary

_GetSuggestedTrackerNames()

Returns a string[] of positional tracker names that are used within the extension wrapper.

public virtual string[] _GetSuggestedTrackerNames()

Returns

string[]

_GetViewportCompositionLayerExtensionProperties()

Gets an array of Dictionarys that represent properties, just like _GetPropertyList(), that will be added to OpenXRCompositionLayer nodes.

public virtual Array<Dictionary> _GetViewportCompositionLayerExtensionProperties()

Returns

Array<Dictionary>

_GetViewportCompositionLayerExtensionPropertyDefaults()

Gets a Dictionary containing the default values for the properties returned by _GetViewportCompositionLayerExtensionProperties().

public virtual Dictionary _GetViewportCompositionLayerExtensionPropertyDefaults()

Returns

Dictionary

_OnBeforeInstanceCreated()

Called before the OpenXR instance is created.

public virtual void _OnBeforeInstanceCreated()

_OnInstanceCreated(ulong)

Called right after the OpenXR instance is created.

public virtual void _OnInstanceCreated(ulong instance)

Parameters

instance ulong

_OnInstanceDestroyed()

Called right before the OpenXR instance is destroyed.

public virtual void _OnInstanceDestroyed()

_OnMainSwapchainsCreated()

Called right after the main swapchains are (re)created.

public virtual void _OnMainSwapchainsCreated()

_OnPreRender()

Called right before the XR viewports begin their rendering step.

public virtual void _OnPreRender()

_OnProcess()

Called as part of the OpenXR process handling. This happens right before general and physics processing steps of the main loop. During this step controller data is queried and made available to game logic.

public virtual void _OnProcess()

_OnRegisterMetadata()

Allows extensions to register additional controller metadata. This function is called even when the OpenXR API is not constructed as the metadata needs to be available to the editor.

Extensions should also provide metadata regardless of whether they are supported on the host system. The controller data is used to setup action maps for users who may have access to the relevant hardware.

public virtual void _OnRegisterMetadata()

_OnSessionCreated(ulong)

Called right after the OpenXR session is created.

public virtual void _OnSessionCreated(ulong session)

Parameters

session ulong

_OnSessionDestroyed()

Called right before the OpenXR session is destroyed.

public virtual void _OnSessionDestroyed()

_OnStateExiting()

Called when the OpenXR session state is changed to exiting.

public virtual void _OnStateExiting()

_OnStateFocused()

Called when the OpenXR session state is changed to focused. This state is the active state when the game runs.

public virtual void _OnStateFocused()

_OnStateIdle()

Called when the OpenXR session state is changed to idle.

public virtual void _OnStateIdle()

_OnStateLossPending()

Called when the OpenXR session state is changed to loss pending.

public virtual void _OnStateLossPending()

_OnStateReady()

Called when the OpenXR session state is changed to ready. This means OpenXR is ready to set up the session.

public virtual void _OnStateReady()

_OnStateStopping()

Called when the OpenXR session state is changed to stopping.

public virtual void _OnStateStopping()

_OnStateSynchronized()

Called when the OpenXR session state is changed to synchronized. OpenXR also returns to this state when the application loses focus.

public virtual void _OnStateSynchronized()

_OnStateVisible()

Called when the OpenXR session state is changed to visible. This means OpenXR is now ready to receive frames.

public virtual void _OnStateVisible()