Ejemplo n.º 1
0
    // Token: 0x060000A1 RID: 161 RVA: 0x00007990 File Offset: 0x00005B90
    public static bool GetBounds(global::SteamVR_PlayArea.Size size, ref global::Valve.VR.HmdQuad_t pRect)
    {
        bool flag = size == global::SteamVR_PlayArea.Size.Calibrated;
        bool result;

        if (flag)
        {
            bool flag2 = !global::SteamVR.active && !global::SteamVR.usingNativeSupport;
            bool flag3 = flag2;
            if (flag3)
            {
                global::Valve.VR.EVRInitError evrinitError = global::Valve.VR.EVRInitError.None;
                global::Valve.VR.OpenVR.Init(ref evrinitError, global::Valve.VR.EVRApplicationType.VRApplication_Other);
            }
            global::Valve.VR.CVRChaperone chaperone = global::Valve.VR.OpenVR.Chaperone;
            bool flag4 = chaperone != null && chaperone.GetPlayAreaRect(ref pRect);
            bool flag5 = !flag4;
            if (flag5)
            {
                global::UnityEngine.Debug.LogWarning("Failed to get Calibrated Play Area bounds!  Make sure you have tracking first, and that your space is calibrated.");
            }
            bool flag6 = flag2;
            if (flag6)
            {
                global::Valve.VR.OpenVR.Shutdown();
            }
            result = flag4;
        }
        else
        {
            try
            {
                string   text  = size.ToString().Substring(1);
                string[] array = text.Split(new char[]
                {
                    'x'
                }, 2);
                float num  = float.Parse(array[0]) / 200f;
                float num2 = float.Parse(array[1]) / 200f;
                pRect.vCorners0.v0 = num;
                pRect.vCorners0.v1 = 0f;
                pRect.vCorners0.v2 = num2;
                pRect.vCorners1.v0 = num;
                pRect.vCorners1.v1 = 0f;
                pRect.vCorners1.v2 = -num2;
                pRect.vCorners2.v0 = -num;
                pRect.vCorners2.v1 = 0f;
                pRect.vCorners2.v2 = -num2;
                pRect.vCorners3.v0 = -num;
                pRect.vCorners3.v1 = 0f;
                pRect.vCorners3.v2 = num2;
                return(true);
            }
            catch
            {
            }
            result = false;
        }
        return(result);
    }
Ejemplo n.º 2
0
        // Token: 0x0600020C RID: 524 RVA: 0x0000D598 File Offset: 0x0000B798
        public static global::Valve.VR.CVRSystem Init(ref global::Valve.VR.EVRInitError peError, global::Valve.VR.EVRApplicationType eApplicationType = global::Valve.VR.EVRApplicationType.VRApplication_Scene)
        {
            global::Valve.VR.OpenVR.VRToken = global::Valve.VR.OpenVR.InitInternal(ref peError, eApplicationType);
            global::Valve.VR.OpenVR.OpenVRInternal_ModuleContext.Clear();
            bool flag = peError > global::Valve.VR.EVRInitError.None;

            global::Valve.VR.CVRSystem result;
            if (flag)
            {
                result = null;
            }
            else
            {
                bool flag2 = global::Valve.VR.OpenVR.IsInterfaceVersionValid("IVRSystem_012");
                bool flag3 = !flag2;
                if (flag3)
                {
                    global::Valve.VR.OpenVR.ShutdownInternal();
                    peError = global::Valve.VR.EVRInitError.Init_InterfaceNotFound;
                    result  = null;
                }
                else
                {
                    result = global::Valve.VR.OpenVR.System;
                }
            }
            return(result);
        }
Ejemplo n.º 3
0
 // Token: 0x06000007 RID: 7 RVA: 0x000021D4 File Offset: 0x000003D4
 private static void ReportError(global::Valve.VR.EVRInitError error)
 {
     if (error <= global::Valve.VR.EVRInitError.Init_VRClientDLLNotFound)
     {
         if (error == global::Valve.VR.EVRInitError.None)
         {
             return;
         }
         if (error == global::Valve.VR.EVRInitError.Init_VRClientDLLNotFound)
         {
             global::UnityEngine.Debug.Log("SteamVR drivers not found!  They can be installed via Steam under Library > Tools.  Visit http://steampowered.com to install Steam.");
             return;
         }
     }
     else
     {
         if (error == global::Valve.VR.EVRInitError.Driver_RuntimeOutOfDate)
         {
             global::UnityEngine.Debug.Log("SteamVR Initialization Failed!  Make sure device's runtime is up to date.");
             return;
         }
         if (error == global::Valve.VR.EVRInitError.VendorSpecific_UnableToConnectToOculusRuntime)
         {
             global::UnityEngine.Debug.Log("SteamVR Initialization Failed!  Make sure device is on, Oculus runtime is installed, and OVRService_*.exe is running.");
             return;
         }
     }
     global::UnityEngine.Debug.Log(global::Valve.VR.OpenVR.GetStringForHmdError(error));
 }
Ejemplo n.º 4
0
            // Token: 0x06000A31 RID: 2609 RVA: 0x00020AAC File Offset: 0x0001ECAC
            public global::Valve.VR.CVRApplications VRApplications()
            {
                this.CheckClear();
                bool flag = this.m_pVRApplications == null;

                if (flag)
                {
                    global::Valve.VR.EVRInitError evrinitError     = global::Valve.VR.EVRInitError.None;
                    global::System.IntPtr         genericInterface = global::Valve.VR.OpenVRInterop.GetGenericInterface("FnTable:IVRApplications_005", ref evrinitError);
                    bool flag2 = genericInterface != global::System.IntPtr.Zero && evrinitError == global::Valve.VR.EVRInitError.None;
                    if (flag2)
                    {
                        this.m_pVRApplications = new global::Valve.VR.CVRApplications(genericInterface);
                    }
                }
                return(this.m_pVRApplications);
            }
Ejemplo n.º 5
0
            // Token: 0x06000A2F RID: 2607 RVA: 0x000209E4 File Offset: 0x0001EBE4
            public global::Valve.VR.CVRExtendedDisplay VRExtendedDisplay()
            {
                this.CheckClear();
                bool flag = this.m_pVRExtendedDisplay == null;

                if (flag)
                {
                    global::Valve.VR.EVRInitError evrinitError     = global::Valve.VR.EVRInitError.None;
                    global::System.IntPtr         genericInterface = global::Valve.VR.OpenVRInterop.GetGenericInterface("FnTable:IVRExtendedDisplay_001", ref evrinitError);
                    bool flag2 = genericInterface != global::System.IntPtr.Zero && evrinitError == global::Valve.VR.EVRInitError.None;
                    if (flag2)
                    {
                        this.m_pVRExtendedDisplay = new global::Valve.VR.CVRExtendedDisplay(genericInterface);
                    }
                }
                return(this.m_pVRExtendedDisplay);
            }
Ejemplo n.º 6
0
    // Token: 0x06000103 RID: 259 RVA: 0x0000B054 File Offset: 0x00009254
    public static object CallSystemFn(global::SteamVR_Utils.SystemFn fn, params object[] args)
    {
        bool flag  = !global::SteamVR.active && !global::SteamVR.usingNativeSupport;
        bool flag2 = flag;

        if (flag2)
        {
            global::Valve.VR.EVRInitError evrinitError = global::Valve.VR.EVRInitError.None;
            global::Valve.VR.OpenVR.Init(ref evrinitError, global::Valve.VR.EVRApplicationType.VRApplication_Other);
        }
        global::Valve.VR.CVRSystem system = global::Valve.VR.OpenVR.System;
        object result = (system != null) ? fn(system, args) : null;
        bool   flag3  = flag;

        if (flag3)
        {
            global::Valve.VR.OpenVR.Shutdown();
        }
        return(result);
    }
Ejemplo n.º 7
0
 // Token: 0x06000006 RID: 6 RVA: 0x00002114 File Offset: 0x00000314
 private static global::SteamVR CreateInstance()
 {
     try
     {
         global::Valve.VR.EVRInitError evrinitError = global::Valve.VR.EVRInitError.None;
         bool flag = !global::SteamVR.usingNativeSupport;
         if (flag)
         {
             global::Valve.VR.OpenVR.Init(ref evrinitError, global::Valve.VR.EVRApplicationType.VRApplication_Scene);
             bool flag2 = evrinitError > global::Valve.VR.EVRInitError.None;
             if (flag2)
             {
                 global::SteamVR.ReportError(evrinitError);
                 global::SteamVR.ShutdownSystems();
                 return(null);
             }
         }
         global::Valve.VR.OpenVR.GetGenericInterface("IVRCompositor_014", ref evrinitError);
         bool flag3 = evrinitError > global::Valve.VR.EVRInitError.None;
         if (flag3)
         {
             global::SteamVR.ReportError(evrinitError);
             global::SteamVR.ShutdownSystems();
             return(null);
         }
         global::Valve.VR.OpenVR.GetGenericInterface("IVROverlay_011", ref evrinitError);
         bool flag4 = evrinitError > global::Valve.VR.EVRInitError.None;
         if (flag4)
         {
             global::SteamVR.ReportError(evrinitError);
             global::SteamVR.ShutdownSystems();
             return(null);
         }
     }
     catch (global::System.Exception ex)
     {
         global::UnityEngine.Debug.LogError(ex);
         return(null);
     }
     return(new global::SteamVR());
 }
Ejemplo n.º 8
0
 internal static extern global::System.IntPtr GetGenericInterface([global::System.Runtime.InteropServices.In][global::System.Runtime.InteropServices.MarshalAs(20)] string pchInterfaceVersion, ref global::Valve.VR.EVRInitError peError);
Ejemplo n.º 9
0
 internal static extern global::System.IntPtr GetStringForHmdError(global::Valve.VR.EVRInitError error);
Ejemplo n.º 10
0
 internal static extern uint InitInternal(ref global::Valve.VR.EVRInitError peError, global::Valve.VR.EVRApplicationType eApplicationType);
Ejemplo n.º 11
0
 // Token: 0x060001F8 RID: 504 RVA: 0x0000D39C File Offset: 0x0000B59C
 public static uint InitInternal(ref global::Valve.VR.EVRInitError peError, global::Valve.VR.EVRApplicationType eApplicationType)
 {
     return(global::Valve.VR.OpenVRInterop.InitInternal(ref peError, eApplicationType));
 }
Ejemplo n.º 12
0
 // Token: 0x060001FD RID: 509 RVA: 0x0000D410 File Offset: 0x0000B610
 public static global::System.IntPtr GetGenericInterface(string pchInterfaceVersion, ref global::Valve.VR.EVRInitError peError)
 {
     return(global::Valve.VR.OpenVRInterop.GetGenericInterface(pchInterfaceVersion, ref peError));
 }
Ejemplo n.º 13
0
 // Token: 0x060001FC RID: 508 RVA: 0x0000D3F0 File Offset: 0x0000B5F0
 public static string GetStringForHmdError(global::Valve.VR.EVRInitError error)
 {
     return(global::System.Runtime.InteropServices.Marshal.PtrToStringAnsi(global::Valve.VR.OpenVRInterop.GetStringForHmdError(error)));
 }