OpenXRExtensionWrapperExtension
Allows clients to implement OpenXR extensions with GDExtension.
OpenXRExtensionWrapperExtension.swift:17class OpenXRExtensionWrapperExtension
OpenXRExtensionWrapperExtension
allows clients to implement OpenXR extensions with GDExtension. The extension should be registered with registerExtensionWrapper
.
Superclasses
class Object
Base class for all other classes in the engine.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func getOpenxrApi(
) -> OpenXRAPIExtension? Returns the created
OpenXRAPIExtension
, which can be used to access the OpenXR API.func registerExtensionWrapper(
) Registers the extension. This should happen at core module initialization level.
Show implementation details (26)
Hide implementation details
func _getCompositionLayer(index: Int32
) -> UInt Returns a pointer to an
XrCompositionLayerBaseHeader
struct to provide the given composition layer.func _getCompositionLayerCount(
) -> Int32 Returns the number of composition layers this extension wrapper provides via
_getCompositionLayer(index:)
.func _getCompositionLayerOrder(index: Int32
) -> Int32 Returns an integer that will be used to sort the given composition layer provided via
_getCompositionLayer(index:)
. 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 of0
, so layers provided by this method should probably be above or below (but not exactly)0
.func _getRequestedExtensions(
) -> GDictionary Returns a
GDictionary
of OpenXR extensions related to this extension. TheGDictionary
should contain the name of the extension, mapped to abool *
cast to an integer:func _getSuggestedTrackerNames(
) -> PackedStringArray Returns a
PackedStringArray
of positional tracker names that are used within the extension wrapper.func _getViewportCompositionLayerExtensionProperties(
) -> VariantCollection<GDictionary> Gets an array of
GDictionary
s that represent properties, just likeObject/_getPropertyList()
, that will be added toOpenXRCompositionLayer
nodes.func _getViewportCompositionLayerExtensionPropertyDefaults(
) -> GDictionary Gets a
GDictionary
containing the default values for the properties returned by_getViewportCompositionLayerExtensionProperties
.func _onBeforeInstanceCreated(
) Called before the OpenXR instance is created.
func _onEventPolled(event: OpaquePointer?
) -> Bool Called when there is an OpenXR event to process. When implementing, return
true
if the event was handled, returnfalse
otherwise.func _onInstanceCreated(instance: UInt
) Called right after the OpenXR instance is created.
func _onInstanceDestroyed(
) Called right before the OpenXR instance is destroyed.
func _onMainSwapchainsCreated(
) Called right after the main swapchains are (re)created.
func _onPreRender(
) Called right before the XR viewports begin their rendering step.
func _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.
func _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.
func _onSessionCreated(session: UInt
) Called right after the OpenXR session is created.
func _onSessionDestroyed(
) Called right before the OpenXR session is destroyed.
func _onStateExiting(
) Called when the OpenXR session state is changed to exiting.
func _onStateFocused(
) Called when the OpenXR session state is changed to focused. This state is the active state when the game runs.
func _onStateIdle(
) Called when the OpenXR session state is changed to idle.
func _onStateLossPending(
) Called when the OpenXR session state is changed to loss pending.
func _onStateReady(
) Called when the OpenXR session state is changed to ready. This means OpenXR is ready to set up the session.
func _onStateStopping(
) Called when the OpenXR session state is changed to stopping.
func _onStateSynchronized(
) Called when the OpenXR session state is changed to synchronized. OpenXR also returns to this state when the application loses focus.
func _onStateVisible(
) Called when the OpenXR session state is changed to visible. This means OpenXR is now ready to receive frames.
func _onViewportCompositionLayerDestroyed(layer: OpaquePointer?
) Called when a composition layer created via
OpenXRCompositionLayer
is destroyed.