Class OpenVRHelper
OpenVR Helper class.
Inherited Members
Namespace: Evergine.OpenVR .Helpers
Assembly: Evergine.OpenVR.dll
Syntax
public static class OpenVRHelper
Methods
GetButtonPressed(VRControllerState_t, EVRButtonId)
Gets the press state of a button.
Declaration
public static bool GetButtonPressed(this VRControllerState_t state, EVRButtonId buttonId)
Parameters
Type | Name | Description |
---|---|---|
VRController |
state | Current controller state. |
EVRButton |
buttonId | Button id. |
Returns
Type | Description |
---|---|
bool | True if button pressed. |
GetButtonState(ref VRControllerState_t, ref VRControllerState_t, EVRButtonId)
Gets the press state of a button.
Declaration
public static ButtonState GetButtonState(ref VRControllerState_t lastState, ref VRControllerState_t state, EVRButtonId buttonId)
Parameters
Type | Name | Description |
---|---|---|
VRController |
lastState | Current controller state of the previous frame. |
VRController |
state | Current controller state. |
EVRButton |
buttonId | Button id. |
Returns
Type | Description |
---|---|
Button |
Pressed state on true value. Release otherwise. |
GetButtonTouched(VRControllerState_t, EVRButtonId)
Gets the touch state of a button.
Declaration
public static bool GetButtonTouched(this VRControllerState_t state, EVRButtonId buttonId)
Parameters
Type | Name | Description |
---|---|---|
VRController |
state | Current controller state. |
EVRButton |
buttonId | Button id. |
Returns
Type | Description |
---|---|
bool | True if button touched. |
ReportCompositeError(EVRCompositorError)
Reports compositor error.
Declaration
public static void ReportCompositeError(EVRCompositorError error)
Parameters
Type | Name | Description |
---|---|---|
EVRCompositor |
error | Compositor error enumerator. |
ReportInitError(EVRInitError)
Reports any error.
Declaration
public static void ReportInitError(EVRInitError error)
Parameters
Type | Name | Description |
---|---|---|
EVRInit |
error | Error enumerator. |
ReportRenderModelError(EVRRenderModelError)
Reports render model error.
Declaration
public static void ReportRenderModelError(EVRRenderModelError error)
Parameters
Type | Name | Description |
---|---|---|
EVRRender |
error | Render model error enumerator. |
ToButtonState(bool)
Converts boolean to button state.
Declaration
public static ButtonState ToButtonState(this bool b)
Parameters
Type | Name | Description |
---|---|---|
bool | b | Current value. |
Returns
Type | Description |
---|---|
Button |
Pressed state on true value. Release otherwise. |
ToDeviceType(ETrackedDeviceClass)
Converts OpenVR device class to OpenXR Device Type.
Declaration
public static XRTrackedDeviceType ToDeviceType(this ETrackedDeviceClass deviceClass)
Parameters
Type | Name | Description |
---|---|---|
ETracked |
deviceClass | The openVR device class. |
Returns
Type | Description |
---|---|
XRTracked |
XR tracking state enum. |
ToEvergine(HmdVector3_t, out Vector3)
Converts a HmwVector3 to Wave Vector3.
Declaration
public static void ToEvergine(this HmdVector3_t hmdVector3, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
Hmd |
hmdVector3 | The hmwVector3. |
Vector3 | result | Evergine Vector3. |
ToEvergine(ref HmdVector3_t, out Vector3)
Converts a HmwVector3 to Wave Vector3.
Declaration
public static void ToEvergine(ref HmdVector3_t hmdVector3, out Vector3 result)
Parameters
Type | Name | Description |
---|---|---|
Hmd |
hmdVector3 | The hmwVector3. |
Vector3 | result | Evergine Vector3. |
ToGenericController(ref VRControllerState_t, ref VRControllerState_t, out XRControllerGenericState)
Converts VR controller state to generic controller.
Declaration
public static void ToGenericController(ref VRControllerState_t lastState, ref VRControllerState_t state, out XRControllerGenericState controllerState)
Parameters
Type | Name | Description |
---|---|---|
VRController |
lastState | VR controller state of the last frame. |
VRController |
state | VR controller state. |
XRController |
controllerState | Generic controller state output parameter. |
ToMatrix(HmdMatrix34_t, out Matrix4x4)
Convert an ovrMatrix44f to a Wave Matrix.
Declaration
public static void ToMatrix(this HmdMatrix34_t ovrMatrix34f, out Matrix4x4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Hmd |
ovrMatrix34f | ovrMatrix44f to convert to a Wave Matrix. |
Matrix4x4 | matrix | Wave Matrix, based on the ovrMatrix4f. |
ToMatrix(ref HmdMatrix34_t, out Matrix4x4)
Convert an ovrMatrix34f to a Wave Matrix.
Declaration
public static void ToMatrix(ref HmdMatrix34_t ovrMatrix34f, out Matrix4x4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Hmd |
ovrMatrix34f | ovrMatrix34f to convert to a Wave Matrix. |
Matrix4x4 | matrix | Wave Matrix, based on the ovrMatrix4f. |
ToMatrix(HmdMatrix44_t, out Matrix4x4)
Convert an ovrMatrix44f to a Wave Matrix.
Declaration
public static void ToMatrix(this HmdMatrix44_t ovrMatrix44f, out Matrix4x4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Hmd |
ovrMatrix44f | ovrMatrix44f to convert to a Wave Matrix. |
Matrix4x4 | matrix | Wave Matrix, based on the ovrMatrix4f. |
ToMatrix(ref HmdMatrix44_t, out Matrix4x4)
Convert an ovrMatrix44f to a Wave Matrix.
Declaration
public static void ToMatrix(ref HmdMatrix44_t ovrMatrix34f, out Matrix4x4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Hmd |
ovrMatrix34f | ovrMatrix44f to convert to a Wave Matrix. |
Matrix4x4 | matrix | Wave Matrix, based on the ovrMatrix4f. |
ToMatrix(TrackedDevicePose_t, out Matrix4x4)
Converts Pose to Matrix.
Declaration
public static void ToMatrix(this TrackedDevicePose_t trackedPose, out Matrix4x4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Tracked |
trackedPose | The trackable pose. |
Matrix4x4 | matrix | Matrix output parameter. |
ToTextureType(GraphicsBackend)
Converts graphics backend to Texture type.
Declaration
public static ETextureType ToTextureType(this GraphicsBackend backend)
Parameters
Type | Name | Description |
---|---|---|
Graphics |
backend | Graphics backend. |
Returns
Type | Description |
---|---|
ETexture |
Texture Type enum. |
ToTrackingState(ETrackingResult)
Converts tracking result to tracking state.
Declaration
public static XRTrackingState ToTrackingState(this ETrackingResult trackingResult)
Parameters
Type | Name | Description |
---|---|---|
ETracking |
trackingResult | The tracking result. |
Returns
Type | Description |
---|---|
XRTracking |
XR tracking state enum. |
ToTrackingState(ref TrackedDevicePose_t, out XRTrackedDeviceState)
Converts device pose to Tracking State.
Declaration
public static void ToTrackingState(ref TrackedDevicePose_t trackedPose, out XRTrackedDeviceState state)
Parameters
Type | Name | Description |
---|---|---|
Tracked |
trackedPose | Device pose. |
XRTracked |
state | Device state. |
ToUInt(TextureSampleCount)
Converts the sample count to integer value.
Declaration
public static uint ToUInt(this TextureSampleCount sampleCount)
Parameters
Type | Name | Description |
---|---|---|
Texture |
sampleCount | The sample count enumerate. |
Returns
Type | Description |
---|---|
uint | The sample count as integer. |
ToVRPose(TrackedDevicePose_t, out Matrix4x4)
Converts TrackedDevicePose to Wave Matrix4x4.
Declaration
public static void ToVRPose(this TrackedDevicePose_t trackedPose, out Matrix4x4 pose)
Parameters
Type | Name | Description |
---|---|---|
Tracked |
trackedPose | The pose. |
Matrix4x4 | pose | Matrix output parameter. |
ToVulkan(PixelFormat)
Converts the pixel format to Vulkan pixel format.
Declaration
public static uint ToVulkan(this PixelFormat pixelFormat)
Parameters
Type | Name | Description |
---|---|---|
Pixel |
pixelFormat | The pixel format. |
Returns
Type | Description |
---|---|
uint | The vulkan pixel format. |
ToXRPose(Matrix4x4, out ViewPose)
Converts matrix to XR Pose.
Declaration
public static void ToXRPose(this Matrix4x4 matrix, out ViewPose pose)
Parameters
ToXRPose(ref Matrix4x4, out ViewPose)
Converts matrix to XR Pose.
Declaration
public static void ToXRPose(ref Matrix4x4 matrix, out ViewPose pose)