OpenXRInterface
Our OpenXR interface.
Our OpenXR interface.
The OpenXR interface allows Reckfell to interact with OpenXR runtimes and make it possible to create XR experiences and games. Due to the needs of OpenXR this interface works slightly different than other plugin based XR interfaces. It needs to be initialized when Reckfell starts. You need to enable OpenXR, settings for this can be found in your games project settings under the XR heading. You do need to mark a viewport for use with XR in order for Reckfell to know which render result should be output to the headset.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
OpenXRInterfaceConstructor
public OpenXRInterface();Properties7
DisplayRefreshRateProperty
public float DisplayRefreshRate { get; set; }The display refresh rate for the current HMD. Only functional if this feature is supported by the OpenXR runtime and after the interface has been initialized.
FoveationDynamicProperty
public bool FoveationDynamic { get; set; }If true, enables dynamic foveation adjustment. The interface must be initialized before this is accessible. If enabled, foveation will automatically be adjusted between low and OpenXRInterface.FoveationLevel.
FoveationLevelProperty
public int FoveationLevel { get; set; }The foveation level, from 0 (off) to 3 (high). The interface must be initialized before this is accessible.
FoveationWithSubsampledImagesProperty
public bool FoveationWithSubsampledImages { get; set; }If true, enables subsampled images with foveation, which can provide a performance boost on Vulkan.
RenderTargetSizeMultiplierProperty
public double RenderTargetSizeMultiplier { get; set; }The render size multiplier for the current HMD. Must be set before the interface has been initialized.
VrsMinRadiusProperty
public float VrsMinRadius { get; set; }The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size.
Note: Mobile and Forward+ renderers only. Requires Viewport.VrsMode to be set to Viewport.VrsModeEnum.XR.
VrsStrengthProperty
public float VrsStrength { get; set; }The strength used to calculate the VRS density map. The greater this value, the more noticeable VRS is. This improves performance at the cost of quality.
Note: Mobile and Forward+ renderers only. Requires Viewport.VrsMode to be set to Viewport.VrsModeEnum.XR.
Methods38
GetActionSetsReckfell.Collections.Array
public Reckfell.Collections.Array GetActionSets();Returns a list of action sets registered with Reckfell (loaded from the action map at runtime).
Reckfell.Collections.ArrayGetActiveViewConfigurationOpenXRInterface.ViewConfiguration
public OpenXRInterface.ViewConfiguration GetActiveViewConfiguration();Gets the active view configuration. Note: This will only return a valid value after OpenXR is initialized.
OpenXRInterface.ViewConfigurationGetAvailableDisplayRefreshRatesReckfell.Collections.Array
public Reckfell.Collections.Array GetAvailableDisplayRefreshRates();Returns a list of display refresh rates supported by the current HMD. Only returned if this feature is supported by the OpenXR runtime and after the interface has been initialized.
Reckfell.Collections.ArrayGetDisplayRefreshRatefloat
public float GetDisplayRefreshRate();floatGetFoveationDynamicbool
public bool GetFoveationDynamic();boolGetFoveationLevelint
public int GetFoveationLevel();intGetFoveationWithSubsampledImagesbool
public bool GetFoveationWithSubsampledImages();boolGetHandJointAngularVelocityVector3 · Deprecated
public Vector3 GetHandJointAngularVelocity(OpenXRInterface.Hand hand, OpenXRInterface.HandJoints joint);If handtracking is enabled, returns the angular velocity of a joint (joint) of a hand (hand) as provided by OpenXR. This is relative to XROrigin3D!
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
joint | OpenXRInterface.HandJoints | — |
Vector3GetHandJointFlagsOpenXRInterface.HandJointFlags · Deprecated
public OpenXRInterface.HandJointFlags GetHandJointFlags(OpenXRInterface.Hand hand, OpenXRInterface.HandJoints joint);If handtracking is enabled, returns flags that inform us of the validity of the tracking data.
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
joint | OpenXRInterface.HandJoints | — |
OpenXRInterface.HandJointFlagsGetHandJointLinearVelocityVector3 · Deprecated
public Vector3 GetHandJointLinearVelocity(OpenXRInterface.Hand hand, OpenXRInterface.HandJoints joint);If handtracking is enabled, returns the linear velocity of a joint (joint) of a hand (hand) as provided by OpenXR. This is relative to XROrigin3D without worldscale applied!
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
joint | OpenXRInterface.HandJoints | — |
Vector3GetHandJointPositionVector3 · Deprecated
public Vector3 GetHandJointPosition(OpenXRInterface.Hand hand, OpenXRInterface.HandJoints joint);If handtracking is enabled, returns the position of a joint (joint) of a hand (hand) as provided by OpenXR. This is relative to XROrigin3D without worldscale applied!
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
joint | OpenXRInterface.HandJoints | — |
Vector3GetHandJointRadiusfloat · Deprecated
public float GetHandJointRadius(OpenXRInterface.Hand hand, OpenXRInterface.HandJoints joint);If handtracking is enabled, returns the radius of a joint (joint) of a hand (hand) as provided by OpenXR. This is without worldscale applied!
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
joint | OpenXRInterface.HandJoints | — |
floatGetHandJointRotationQuaternion · Deprecated
public Quaternion GetHandJointRotation(OpenXRInterface.Hand hand, OpenXRInterface.HandJoints joint);If handtracking is enabled, returns the rotation of a joint (joint) of a hand (hand) as provided by OpenXR.
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
joint | OpenXRInterface.HandJoints | — |
QuaternionGetHandTrackingSourceOpenXRInterface.HandTrackedSource · Deprecated
public OpenXRInterface.HandTrackedSource GetHandTrackingSource(OpenXRInterface.Hand hand);If handtracking is enabled and hand tracking source is supported, gets the source of the hand tracking data for hand.
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
OpenXRInterface.HandTrackedSourceGetMotionRangeOpenXRInterface.HandMotionRange
public OpenXRInterface.HandMotionRange GetMotionRange(OpenXRInterface.Hand hand);If handtracking is enabled and motion range is supported, gets the currently configured motion range for hand.
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
OpenXRInterface.HandMotionRangeGetRecommendedTargetSizeVector2
public Vector2 GetRecommendedTargetSize();Returns the recommended render target size from the OpenXR runtime.
This may not match the current render target size returned by XRInterface.GetRenderTargetSize.
Vector2GetRenderTargetSizeMultiplierdouble
public double GetRenderTargetSizeMultiplier();doubleGetSessionStateOpenXRInterface.SessionState
public OpenXRInterface.SessionState GetSessionState();Returns the current state of our OpenXR session.
OpenXRInterface.SessionStateGetVrsMinRadiusfloat
public float GetVrsMinRadius();floatGetVrsStrengthfloat
public float GetVrsStrength();floatIsActionSetActivebool
public bool IsActionSetActive(string name);Returns true if the given action set is active.
| Name | Type | Default |
|---|---|---|
name | string | — |
boolIsEyeGazeInteractionSupportedbool
public bool IsEyeGazeInteractionSupported();Returns the capabilities of the eye gaze interaction extension. Note: This only returns a valid value after OpenXR has been initialized.
boolIsFoveationSupportedbool
public bool IsFoveationSupported();Returns true if OpenXR's foveation extension is supported. The interface must be initialized before this returns a valid value.
Note: When using the Vulkan rendering driver, Viewport.VrsMode must be set to Viewport.VrsModeEnum.XR to support foveation.
boolIsHandInteractionSupportedbool
public bool IsHandInteractionSupported();Returns true if OpenXR's hand interaction profile is supported and enabled.
Note: This only returns a valid value after OpenXR has been initialized.
boolIsHandTrackingSupportedbool
public bool IsHandTrackingSupported();Returns true if OpenXR's hand tracking is supported and enabled.
Note: This only returns a valid value after OpenXR has been initialized.
boolIsUserPresenceSupportedbool
public bool IsUserPresenceSupported();Returns true if OpenXR's user presence extension is supported and enabled.
Note: This only returns a valid value after OpenXR has been initialized.
boolIsUserPresentbool
public bool IsUserPresent();Returns true if system has detected the presence of a user in the XR experience.
boolSetActionSetActivevoid
public void SetActionSetActive(string name, bool active);Sets the given action set as active or inactive.
| Name | Type | Default |
|---|---|---|
name | string | — |
active | bool | — |
SetCpuLevelvoid
public void SetCpuLevel(OpenXRInterface.PerfSettingsLevel level);Sets the CPU performance level of the OpenXR device.
| Name | Type | Default |
|---|---|---|
level | OpenXRInterface.PerfSettingsLevel | — |
SetDisplayRefreshRatevoid
public void SetDisplayRefreshRate(float refreshRate);| Name | Type | Default |
|---|---|---|
refreshRate | float | — |
SetFoveationDynamicvoid
public void SetFoveationDynamic(bool foveationDynamic);| Name | Type | Default |
|---|---|---|
foveationDynamic | bool | — |
SetFoveationLevelvoid
public void SetFoveationLevel(int foveationLevel);| Name | Type | Default |
|---|---|---|
foveationLevel | int | — |
SetFoveationWithSubsampledImagesvoid
public void SetFoveationWithSubsampledImages(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetGpuLevelvoid
public void SetGpuLevel(OpenXRInterface.PerfSettingsLevel level);Sets the GPU performance level of the OpenXR device.
| Name | Type | Default |
|---|---|---|
level | OpenXRInterface.PerfSettingsLevel | — |
SetMotionRangevoid
public void SetMotionRange(OpenXRInterface.Hand hand, OpenXRInterface.HandMotionRange motionRange);If handtracking is enabled and motion range is supported, sets the currently configured motion range for hand to motion_range.
| Name | Type | Default |
|---|---|---|
hand | OpenXRInterface.Hand | — |
motionRange | OpenXRInterface.HandMotionRange | — |
SetRenderTargetSizeMultipliervoid
public void SetRenderTargetSizeMultiplier(double multiplier);| Name | Type | Default |
|---|---|---|
multiplier | double | — |
SetVrsMinRadiusvoid
public void SetVrsMinRadius(float radius);| Name | Type | Default |
|---|---|---|
radius | float | — |
SetVrsStrengthvoid
public void SetVrsStrength(float strength);| Name | Type | Default |
|---|---|---|
strength | float | — |
Signals and events12
CpuLevelChangedEvent
public event OpenXRInterface.CpuLevelChangedEventHandler CpuLevelChanged;Informs the device CPU performance level has changed in the specified subdomain.
| Name | Type | Default |
|---|---|---|
subDomain | long | — |
fromLevel | long | — |
toLevel | long | — |
GpuLevelChangedEvent
public event OpenXRInterface.GpuLevelChangedEventHandler GpuLevelChanged;Informs the device GPU performance level has changed in the specified subdomain.
| Name | Type | Default |
|---|---|---|
subDomain | long | — |
fromLevel | long | — |
toLevel | long | — |
InstanceExitingEvent
public event Action InstanceExiting;Informs our OpenXR instance is exiting.
PoseRecenteredEvent
public event Action PoseRecentered;Informs the user queued a recenter of the player position.
RefreshRateChangedEvent
public event OpenXRInterface.RefreshRateChangedEventHandler RefreshRateChanged;Informs the user the HMD refresh rate has changed. Note: Only emitted if XR runtime supports the refresh rate extension.
| Name | Type | Default |
|---|---|---|
refreshRate | double | — |
SessionBegunEvent
public event Action SessionBegun;Informs our OpenXR session has been started.
SessionFocussedEvent
public event Action SessionFocussed;Informs our OpenXR session now has focus, for example output is sent to the HMD and we're receiving XR input.
SessionLossPendingEvent
public event Action SessionLossPending;Informs our OpenXR session is in the process of being lost.
SessionStoppingEvent
public event Action SessionStopping;Informs our OpenXR session is stopping.
SessionSynchronizedEvent
public event Action SessionSynchronized;Informs our OpenXR session has been synchronized.
SessionVisibleEvent
public event Action SessionVisible;Informs our OpenXR session is now visible, for example output is sent to the HMD but we don't receive XR input.
UserPresenceChangedEvent
public event OpenXRInterface.UserPresenceChangedEventHandler UserPresenceChanged;Signal emitted when the user presence value changes. Note: This signal will not be emitted during application startup and application shutdown. Developers should assume user presence is gained on startup and lost on shutdown.
| Name | Type | Default |
|---|---|---|
isUserPresent | bool | — |
OpenXRInterface.Hand
OpenXRInterface.HandJointFlags
| Value | Description |
|---|---|
AngularVelocityValid = 32 | If set, our angular velocity data is valid, otherwise, the angular velocity data is unreliable and should not be used. |
LinearVelocityValid = 16 | If set, our linear velocity data is valid, otherwise, the linear velocity data is unreliable and should not be used. |
None = 0 | No flags are set. |
OrientationTracked = 2 | If set, the orientation data comes from tracking data, otherwise, the orientation data contains predicted data. |
OrientationValid = 1 | If set, the orientation data is valid, otherwise, the orientation data is unreliable and should not be used. |
PositionTracked = 8 | If set, the positional data comes from tracking data, otherwise, the positional data contains predicted data. |
PositionValid = 4 | If set, the positional data is valid, otherwise, the positional data is unreliable and should not be used. |
OpenXRInterface.HandJoints
| Value | Description |
|---|---|
IndexDistal = 9 | Index finger phalanx distal joint. |
IndexIntermediate = 8 | Index finger phalanx intermediate joint. |
IndexMetacarpal = 6 | Index finger metacarpal joint. |
IndexProximal = 7 | Index finger phalanx proximal joint. |
IndexTip = 10 | Index finger tip joint. |
LittleDistal = 24 | Pinky finger phalanx distal joint. |
LittleIntermediate = 23 | Pinky finger phalanx intermediate joint. |
LittleMetacarpal = 21 | Pinky finger metacarpal joint. |
LittleProximal = 22 | Pinky finger phalanx proximal joint. |
LittleTip = 25 | Pinky finger tip joint. |
Max = 26 | Represents the size of the |
MiddleDistal = 14 | Middle finger phalanx distal joint. |
MiddleIntermediate = 13 | Middle finger phalanx intermediate joint. |
MiddleMetacarpal = 11 | Middle finger metacarpal joint. |
MiddleProximal = 12 | Middle finger phalanx proximal joint. |
MiddleTip = 15 | Middle finger tip joint. |
Palm = 0 | Palm joint. |
RingDistal = 19 | Ring finger phalanx distal joint. |
RingIntermediate = 18 | Ring finger phalanx intermediate joint. |
RingMetacarpal = 16 | Ring finger metacarpal joint. |
RingProximal = 17 | Ring finger phalanx proximal joint. |
RingTip = 20 | Ring finger tip joint. |
ThumbDistal = 4 | Thumb distal joint. |
ThumbMetacarpal = 2 | Thumb metacarpal joint. |
ThumbProximal = 3 | Thumb proximal joint. |
ThumbTip = 5 | Thumb tip joint. |
Wrist = 1 | Wrist joint. |
OpenXRInterface.HandMotionRange
| Value | Description |
|---|---|
ConformToController = 1 | Conform to controller, if user closes their hands, the tracked data conforms to the shape of the controller. |
Max = 2 | Maximum value for the motion range enum. |
Unobstructed = 0 | Full hand range, if user closes their hands, we make a full fist. |
OpenXRInterface.HandTrackedSource
| Value | Description |
|---|---|
Controller = 2 | The source of hand tracking is a controller, bone positions are inferred from controller inputs. |
Max = 3 | Represents the size of the |
Unknown = 0 | The source of hand tracking data is unknown (the extension is likely unsupported). |
Unobstructed = 1 | The source of hand tracking is unobstructed, this means that an accurate method of hand tracking is used, e.g. optical hand tracking, data gloves, etc. |
OpenXRInterface.PerfSettingsLevel
| Value | Description |
|---|---|
Boost = 3 | The application has entered a section with very high complexity, during which the XR Runtime is allowed to step up beyond the thermally sustainable range. |
PowerSavings = 0 | The application has entered a non-XR section (head-locked / static screen), during which power savings are to be prioritized. |
SustainedHigh = 2 | The application has entered a high or dynamic complexity section, during which the XR Runtime strives for consistent XR compositing and frame rendering within a thermally sustainable range. |
SustainedLow = 1 | The application has entered a low and stable complexity section, during which reducing power is more important than occasional late rendering frames. |
OpenXRInterface.PerfSettingsNotificationLevel
| Value | Description |
|---|---|
Impaired = 2 | The sub-domain has reached a critical level where the application should start drastic mitigation actions. |
Normal = 0 | The sub-domain has reached a level where no further actions other than currently applied are necessary. |
Warning = 1 | The sub-domain has reached an early warning level where the application should start proactive mitigation actions. |
OpenXRInterface.PerfSettingsSubDomain
| Value | Description |
|---|---|
Compositing = 0 | The compositing performance within the runtime has reached a new level. |
Rendering = 1 | The application rendering performance has reached a new level. |
Thermal = 2 | The temperature of the device has reached a new level. |
OpenXRInterface.SessionState
| Value | Description |
|---|---|
Exiting = 8 | The OpenXR instance is about to be destroyed and we're exiting. |
Focused = 5 | The application has synched its frame loop with the runtime, we're rendering output to the user and we're receiving XR input. |
Idle = 1 | The initial state after the OpenXR session is created or after the session is destroyed. |
LossPending = 7 | The session is about to be lost. |
Ready = 2 | OpenXR is ready to begin our session. |
Stopping = 6 | Our session is being stopped. |
Synchronized = 3 | The application has synched its frame loop with the runtime but we're not rendering anything. |
Unknown = 0 | The state of the session is unknown, we haven't tried setting up OpenXR yet. |
Visible = 4 | The application has synched its frame loop with the runtime and we're rendering output to the user, however we receive no user input. |
OpenXRInterface.ViewConfiguration
| Value | Description |
|---|---|
Mono = 0 | Our XR output configuration is monoscopic. |
Stereo = 1 | Our XR output configuration is stereoscopic. |
StereoWithInset = 2 | Our XR output configuration is stereoscopic with an additional foveated inset render. |
Unknown = 255 | Our XR output configuration is unknown. |
Unset = 254 | Our XR output configuration has not yet been determined. |