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 |
---|---|---|
VRControllerState_t | state | Current controller state. |
EVRButtonId | 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 |
---|---|---|
VRControllerState_t | lastState | Current controller state of the previous frame. |
VRControllerState_t | state | Current controller state. |
EVRButtonId | buttonId | Button id. |
Returns
Type | Description |
---|---|
ButtonState | 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 |
---|---|---|
VRControllerState_t | state | Current controller state. |
EVRButtonId | 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 |
---|---|---|
EVRCompositorError | error | Compositor error enumerator. |
ReportInitError(EVRInitError)
Reports any error.
Declaration
public static void ReportInitError(EVRInitError error)
Parameters
Type | Name | Description |
---|---|---|
EVRInitError | error | Error enumerator. |
ReportRenderModelError(EVRRenderModelError)
Reports render model error.
Declaration
public static void ReportRenderModelError(EVRRenderModelError error)
Parameters
Type | Name | Description |
---|---|---|
EVRRenderModelError | 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 |
---|---|
ButtonState | 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 |
---|---|---|
ETrackedDeviceClass | deviceClass | The openVR device class. |
Returns
Type | Description |
---|---|
XRTrackedDeviceType | 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 |
---|---|---|
HmdVector3_t | 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 |
---|---|---|
HmdVector3_t | 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 |
---|---|---|
VRControllerState_t | lastState | VR controller state of the last frame. |
VRControllerState_t | state | VR controller state. |
XRControllerGenericState | 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 |
---|---|---|
HmdMatrix34_t | 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 |
---|---|---|
HmdMatrix34_t | 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 |
---|---|---|
HmdMatrix44_t | 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 |
---|---|---|
HmdMatrix44_t | 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 |
---|---|---|
TrackedDevicePose_t | 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 |
---|---|---|
GraphicsBackend | backend | Graphics backend. |
Returns
Type | Description |
---|---|
ETextureType | Texture Type enum. |
ToTrackingState(ETrackingResult)
Converts tracking result to tracking state.
Declaration
public static XRTrackingState ToTrackingState(this ETrackingResult trackingResult)
Parameters
Type | Name | Description |
---|---|---|
ETrackingResult | trackingResult | The tracking result. |
Returns
Type | Description |
---|---|
XRTrackingState | 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 |
---|---|---|
TrackedDevicePose_t | trackedPose | Device pose. |
XRTrackedDeviceState | state | Device state. |
ToUInt(TextureSampleCount)
Converts the sample count to integer value.
Declaration
public static uint ToUInt(this TextureSampleCount sampleCount)
Parameters
Type | Name | Description |
---|---|---|
TextureSampleCount | 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 |
---|---|---|
TrackedDevicePose_t | 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 |
---|---|---|
PixelFormat | 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
Type | Name | Description |
---|---|---|
Matrix4x4 | matrix | The matrix. |
ViewPose | pose | Pose output parameter. |
ToXRPose(ref Matrix4x4, out ViewPose)
Converts matrix to XR Pose.
Declaration
public static void ToXRPose(ref Matrix4x4 matrix, out ViewPose pose)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | matrix | The matrix. |
ViewPose | pose | Pose output parameter. |