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: 0x060000A7 RID: 167 RVA: 0x000080B3 File Offset: 0x000062B3
    private global::System.Collections.IEnumerator UpdateBounds()
    {
        base.GetComponent <global::UnityEngine.MeshFilter>().mesh = null;
        global::Valve.VR.CVRChaperone chaperone = global::Valve.VR.OpenVR.Chaperone;
        bool flag = chaperone == null;

        if (flag)
        {
            yield break;
        }
        while (chaperone.GetCalibrationState() != global::Valve.VR.ChaperoneCalibrationState.OK)
        {
            yield return(null);
        }
        this.BuildMesh();
        yield break;
    }