Table of Contents

Class XRInterfaceExtension

Namespace
Godot
Assembly
GodotSharp.dll

External XR interface plugins should inherit from this class.

public class XRInterfaceExtension : XRInterface, IDisposable
Inheritance
XRInterfaceExtension
Implements
Inherited Members

Constructors

XRInterfaceExtension()

public XRInterfaceExtension()

Methods

AddBlit(Rid, Rect2, Rect2I, bool, uint, bool, Vector2, double, double, double, double)

Blits our render results to screen optionally applying lens distortion. This can only be called while processing _commit_views.

public void AddBlit(Rid renderTarget, Rect2 srcRect, Rect2I dstRect, bool useLayer, uint layer, bool applyLensDistortion, Vector2 eyeCenter, double k1, double k2, double upscale, double aspectRatio)

Parameters

renderTarget Rid
srcRect Rect2
dstRect Rect2I
useLayer bool
layer uint
applyLensDistortion bool
eyeCenter Vector2
k1 double
k2 double
upscale double
aspectRatio double

GetColorTexture()

public Rid GetColorTexture()

Returns

Rid

GetDepthTexture()

public Rid GetDepthTexture()

Returns

Rid

GetRenderTargetTexture(Rid)

Returns a valid Rid for a texture to which we should render the current frame if supported by the interface.

public Rid GetRenderTargetTexture(Rid renderTarget)

Parameters

renderTarget Rid

Returns

Rid

GetVelocityTexture()

public Rid GetVelocityTexture()

Returns

Rid

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

_EndFrame()

Called if interface is active and queues have been submitted.

public virtual void _EndFrame()

_GetAnchorDetectionIsEnabled()

Return true if anchor detection is enabled for this interface.

public virtual bool _GetAnchorDetectionIsEnabled()

Returns

bool

_GetCameraFeedId()

Returns the camera feed ID for the CameraFeed registered with the CameraServer that should be presented as the background on an AR capable device (if applicable).

public virtual int _GetCameraFeedId()

Returns

int

_GetCameraTransform()

Returns the Transform3D that positions the XRCamera3D in the world.

public virtual Transform3D _GetCameraTransform()

Returns

Transform3D

_GetCapabilities()

Returns the capabilities of this interface.

public virtual uint _GetCapabilities()

Returns

uint

_GetColorTexture()

Return color texture into which to render (if applicable).

public virtual Rid _GetColorTexture()

Returns

Rid

_GetDepthTexture()

Return depth texture into which to render (if applicable).

public virtual Rid _GetDepthTexture()

Returns

Rid

_GetName()

Returns the name of this interface.

public virtual StringName _GetName()

Returns

StringName

_GetPlayArea()

Returns an Vector3[] that denotes the play areas boundaries (if applicable).

public virtual Vector3[] _GetPlayArea()

Returns

Vector3[]

_GetPlayAreaMode()

Returns the XRInterface.PlayAreaMode that sets up our play area.

public virtual XRInterface.PlayAreaMode _GetPlayAreaMode()

Returns

XRInterface.PlayAreaMode

_GetProjectionForView(uint, double, double, double)

Returns the projection matrix for the given view as a double[].

public virtual double[] _GetProjectionForView(uint view, double aspect, double zNear, double zFar)

Parameters

view uint
aspect double
zNear double
zFar double

Returns

double[]

_GetRenderTargetSize()

Returns the size of our render target for this interface, this overrides the size of the Viewport marked as the xr viewport.

public virtual Vector2 _GetRenderTargetSize()

Returns

Vector2

_GetSuggestedPoseNames(StringName)

Returns a string[] with pose names configured by this interface. Note that user configuration can override this list.

public virtual string[] _GetSuggestedPoseNames(StringName trackerName)

Parameters

trackerName StringName

Returns

string[]

_GetSuggestedTrackerNames()

Returns a string[] with tracker names configured by this interface. Note that user configuration can override this list.

public virtual string[] _GetSuggestedTrackerNames()

Returns

string[]

_GetSystemInfo()

Returns a Dictionary with system information related to this interface.

public virtual Dictionary _GetSystemInfo()

Returns

Dictionary

_GetTrackingStatus()

Returns a XRInterface.TrackingStatus specifying the current status of our tracking.

public virtual XRInterface.TrackingStatus _GetTrackingStatus()

Returns

XRInterface.TrackingStatus

_GetTransformForView(uint, Transform3D)

Returns a Transform3D for a given view.

public virtual Transform3D _GetTransformForView(uint view, Transform3D camTransform)

Parameters

view uint
camTransform Transform3D

Returns

Transform3D

_GetVelocityTexture()

Return velocity texture into which to render (if applicable).

public virtual Rid _GetVelocityTexture()

Returns

Rid

_GetViewCount()

Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic.

public virtual uint _GetViewCount()

Returns

uint

_GetVrsTexture()

public virtual Rid _GetVrsTexture()

Returns

Rid

_Initialize()

Initializes the interface, returns true on success.

public virtual bool _Initialize()

Returns

bool

_IsInitialized()

Returns true if this interface has been initialized.

public virtual bool _IsInitialized()

Returns

bool

_PostDrawViewport(Rid, Rect2)

Called after the XR Viewport draw logic has completed.

public virtual void _PostDrawViewport(Rid renderTarget, Rect2 screenRect)

Parameters

renderTarget Rid
screenRect Rect2

_PreDrawViewport(Rid)

Called if this is our primary XRInterfaceExtension before we start processing a Viewport for every active XR Viewport, returns true if that viewport should be rendered. An XR interface may return false if the user has taken off their headset and we can pause rendering.

public virtual bool _PreDrawViewport(Rid renderTarget)

Parameters

renderTarget Rid

Returns

bool

_PreRender()

Called if this XRInterfaceExtension is active before rendering starts. Most XR interfaces will sync tracking at this point in time.

public virtual void _PreRender()

_Process()

Called if this XRInterfaceExtension is active before our physics and game process is called. Most XR interfaces will update its XRPositionalTrackers at this point in time.

public virtual void _Process()

_SetAnchorDetectionIsEnabled(bool)

Enables anchor detection on this interface if supported.

public virtual void _SetAnchorDetectionIsEnabled(bool enabled)

Parameters

enabled bool

_SetPlayAreaMode(PlayAreaMode)

Set the play area mode for this interface.

public virtual bool _SetPlayAreaMode(XRInterface.PlayAreaMode mode)

Parameters

mode XRInterface.PlayAreaMode

Returns

bool

_SupportsPlayAreaMode(PlayAreaMode)

Returns true if this interface supports this play area mode.

public virtual bool _SupportsPlayAreaMode(XRInterface.PlayAreaMode mode)

Parameters

mode XRInterface.PlayAreaMode

Returns

bool

_TriggerHapticPulse(string, StringName, double, double, double, double)

Triggers a haptic pulse to be emitted on the specified tracker.

public virtual void _TriggerHapticPulse(string actionName, StringName trackerName, double frequency, double amplitude, double durationSec, double delaySec)

Parameters

actionName string
trackerName StringName
frequency double
amplitude double
durationSec double
delaySec double

_Uninitialize()

Uninitialize the interface.

public virtual void _Uninitialize()