XRInterfaceExtension
Base class for XR interface extensions (plugins).
Base class for XR interface extensions (plugins).
External XR interface plugins should inherit from this class.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
XRInterfaceExtensionConstructor
public XRInterfaceExtension();Methods39
AddBlitvoid
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);Blits our render results to screen optionally applying lens distortion. This can only be called while processing _commit_views.
| Name | Type | Default |
|---|---|---|
renderTarget | Rid | — |
srcRect | Rect2 | — |
dstRect | Rect2I | — |
useLayer | bool | — |
layer | uint | — |
applyLensDistortion | bool | — |
eyeCenter | Vector2 | — |
k1 | double | — |
k2 | double | — |
upscale | double | — |
aspectRatio | double | — |
GetColorTextureRid
public Rid GetColorTexture();Return color texture into which to render (if applicable).
RidGetDepthTextureRid
public Rid GetDepthTexture();Return depth texture into which to render (if applicable).
RidGetRenderTargetTextureRid
public Rid GetRenderTargetTexture(Rid renderTarget);Returns a valid Rid for a texture to which we should render the current frame if supported by the interface.
| Name | Type | Default |
|---|---|---|
renderTarget | Rid | — |
RidGetVelocityTextureRid
public Rid GetVelocityTexture();Return velocity texture into which to render (if applicable).
Rid_EndFramevoid
public virtual void _EndFrame();Called if interface is active and queues have been submitted.
_GetAnchorDetectionIsEnabledbool
public virtual bool _GetAnchorDetectionIsEnabled();Return true if anchor detection is enabled for this interface.
bool_GetCameraFeedIdint
public virtual int _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).
int_GetCameraOffsetsReckfell.Collections.Array<Transform3D>
public virtual Reckfell.Collections.Array<Transform3D> _GetCameraOffsets(StringName trackerName);Gets an array of offset transforms for each view for tracker tracker_name. tracker_name must refer to an XRPositionalTracker used as a camera. Returns an empty array if this interface is not responsible for this tracker.
| Name | Type | Default |
|---|---|---|
trackerName | StringName | — |
Reckfell.Collections.Array<Transform3D>_GetCameraProjectionsReckfell.Collections.Array<Projection>
public virtual Reckfell.Collections.Array<Projection> _GetCameraProjections(StringName trackerName, double aspect, double zNear, double zFar);Gets an array of projection matrices for each view for tracker tracker_name. tracker_name must refer to an XRPositionalTracker used as a camera. Returns an empty array if this interface is not responsible for this tracker.
| Name | Type | Default |
|---|---|---|
trackerName | StringName | — |
aspect | double | — |
zNear | double | — |
zFar | double | — |
Reckfell.Collections.Array<Projection>_GetCameraTransformTransform3D
public virtual Transform3D _GetCameraTransform();Returns the Transform3D that positions the XRCamera3D in the world.
Transform3D_GetCapabilitiesuint
public virtual uint _GetCapabilities();Returns the capabilities of this interface.
uint_GetColorTextureRid
public virtual Rid _GetColorTexture();Return color texture into which to render (if applicable).
Rid_GetDepthTextureRid
public virtual Rid _GetDepthTexture();Return depth texture into which to render (if applicable).
Rid_GetNameStringName
public virtual StringName _GetName();Returns the name of this interface.
StringName_GetPlayAreaVector3[]
public virtual Vector3[] _GetPlayArea();Returns a Vector3[] that represents the play areas boundaries (if applicable).
Vector3[]_GetPlayAreaModeXRInterface.PlayAreaMode
public virtual XRInterface.PlayAreaMode _GetPlayAreaMode();Returns the play area mode that sets up our play area.
XRInterface.PlayAreaMode_GetProjectionForViewdouble[] · Deprecated
public virtual double[] _GetProjectionForView(uint view, double aspect, double zNear, double zFar);Returns the projection matrix for the given view as a double[].
| Name | Type | Default |
|---|---|---|
view | uint | — |
aspect | double | — |
zNear | double | — |
zFar | double | — |
double[]_GetRenderTargetSizeVector2
public virtual Vector2 _GetRenderTargetSize();Returns the size of our render target for this interface, this overrides the size of the Viewport marked as the xr viewport.
Vector2_GetSuggestedPoseNamesstring[]
public virtual string[] _GetSuggestedPoseNames(StringName trackerName);Returns a string[] with pose names configured by this interface. Note that user configuration can override this list.
| Name | Type | Default |
|---|---|---|
trackerName | StringName | — |
string[]_GetSuggestedTrackerNamesstring[]
public virtual string[] _GetSuggestedTrackerNames();Returns a string[] with tracker names configured by this interface. Note that user configuration can override this list.
string[]_GetSystemInfoReckfell.Collections.Dictionary
public virtual Reckfell.Collections.Dictionary _GetSystemInfo();Returns a Reckfell.Collections.Dictionary with system information related to this interface.
Reckfell.Collections.Dictionary_GetTrackingStatusXRInterface.TrackingStatus
public virtual XRInterface.TrackingStatus _GetTrackingStatus();Returns the current status of our tracking.
XRInterface.TrackingStatus_GetTransformForViewTransform3D · Deprecated
public virtual Transform3D _GetTransformForView(uint view, Transform3D camTransform);Returns a Transform3D for a given view.
| Name | Type | Default |
|---|---|---|
view | uint | — |
camTransform | Transform3D | — |
Transform3D_GetVelocityTextureRid
public virtual Rid _GetVelocityTexture();Return velocity texture into which to render (if applicable).
Rid_GetViewCountuint
public virtual uint _GetViewCount();Returns the number of views this interface requires, 1 for mono, 2 for stereoscopic.
uint_GetVrsTextureRid
public virtual Rid _GetVrsTexture();Rid_GetVrsTextureFormatXRInterface.VrsTextureFormat
public virtual XRInterface.VrsTextureFormat _GetVrsTextureFormat();Returns the format of the texture returned by XRInterfaceExtension._GetVrsTexture.
XRInterface.VrsTextureFormat_Initializebool
public virtual bool _Initialize();Initializes the interface, returns true on success.
bool_IsInitializedbool
public virtual bool _IsInitialized();Returns true if this interface has been initialized.
bool_PostDrawViewportvoid
public virtual void _PostDrawViewport(Rid renderTarget, Rect2 screenRect);Called after the XR Viewport draw logic has completed.
| Name | Type | Default |
|---|---|---|
renderTarget | Rid | — |
screenRect | Rect2 | — |
_PreDrawViewportbool
public virtual bool _PreDrawViewport(Rid renderTarget);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.
| Name | Type | Default |
|---|---|---|
renderTarget | Rid | — |
bool_PreRendervoid
public virtual void _PreRender();Called if this XRInterfaceExtension is active before rendering starts. Most XR interfaces will sync tracking at this point in time.
_Processvoid
public virtual void _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.
_SetAnchorDetectionIsEnabledvoid
public virtual void _SetAnchorDetectionIsEnabled(bool enabled);Enables anchor detection on this interface if supported.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
_SetPlayAreaModebool
public virtual bool _SetPlayAreaMode(XRInterface.PlayAreaMode mode);Set the play area mode for this interface.
| Name | Type | Default |
|---|---|---|
mode | XRInterface.PlayAreaMode | — |
bool_SupportsPlayAreaModebool
public virtual bool _SupportsPlayAreaMode(XRInterface.PlayAreaMode mode);Returns true if this interface supports this play area mode.
| Name | Type | Default |
|---|---|---|
mode | XRInterface.PlayAreaMode | — |
bool_TriggerHapticPulsevoid
public virtual void _TriggerHapticPulse(string actionName, StringName trackerName, double frequency, double amplitude, double durationSec, double delaySec);Triggers a haptic pulse to be emitted on the specified tracker.
| Name | Type | Default |
|---|---|---|
actionName | string | — |
trackerName | StringName | — |
frequency | double | — |
amplitude | double | — |
durationSec | double | — |
delaySec | double | — |
_Uninitializevoid
public virtual void _Uninitialize();Uninitialize the interface.