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
RidsrcRect
Rect2dstRect
Rect2IuseLayer
boollayer
uintapplyLensDistortion
booleyeCenter
Vector2k1
doublek2
doubleupscale
doubleaspectRatio
double
GetColorTexture()
public Rid GetColorTexture()
Returns
GetDepthTexture()
public Rid GetDepthTexture()
Returns
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
GetVelocityTexture()
public Rid GetVelocityTexture()
Returns
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_nameName of the method to check for.
Returns
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_nameName of the signal to check for.
Returns
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_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
_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
_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
_GetCameraTransform()
Returns the Transform3D that positions the XRCamera3D in the world.
public virtual Transform3D _GetCameraTransform()
Returns
_GetCapabilities()
Returns the capabilities of this interface.
public virtual uint _GetCapabilities()
Returns
_GetColorTexture()
Return color texture into which to render (if applicable).
public virtual Rid _GetColorTexture()
Returns
_GetDepthTexture()
Return depth texture into which to render (if applicable).
public virtual Rid _GetDepthTexture()
Returns
_GetName()
Returns the name of this interface.
public virtual StringName _GetName()
Returns
_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
_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
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
_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
_GetTrackingStatus()
Returns a XRInterface.TrackingStatus specifying the current status of our tracking.
public virtual XRInterface.TrackingStatus _GetTrackingStatus()
Returns
_GetTransformForView(uint, Transform3D)
Returns a Transform3D for a given view.
public virtual Transform3D _GetTransformForView(uint view, Transform3D camTransform)
Parameters
view
uintcamTransform
Transform3D
Returns
_GetVelocityTexture()
Return velocity texture into which to render (if applicable).
public virtual Rid _GetVelocityTexture()
Returns
_GetViewCount()
Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic.
public virtual uint _GetViewCount()
Returns
_GetVrsTexture()
public virtual Rid _GetVrsTexture()
Returns
_Initialize()
Initializes the interface, returns true
on success.
public virtual bool _Initialize()
Returns
_IsInitialized()
Returns true
if this interface has been initialized.
public virtual bool _IsInitialized()
Returns
_PostDrawViewport(Rid, Rect2)
Called after the XR Viewport draw logic has completed.
public virtual void _PostDrawViewport(Rid renderTarget, Rect2 screenRect)
Parameters
_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
_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
_SupportsPlayAreaMode(PlayAreaMode)
Returns true
if this interface supports this play area mode.
public virtual bool _SupportsPlayAreaMode(XRInterface.PlayAreaMode mode)
Parameters
mode
XRInterface.PlayAreaMode
Returns
_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
stringtrackerName
StringNamefrequency
doubleamplitude
doubledurationSec
doubledelaySec
double
_Uninitialize()
Uninitialize the interface.
public virtual void _Uninitialize()