public override Vector3 GetPlayspaceBounds() { bool initOpenVR = (!SteamVR.active && !SteamVR.usingNativeSupport); if (initOpenVR) { EVRInitError error = EVRInitError.None; OpenVR.Init(ref error, EVRApplicationType.VRApplication_Other); } CVRChaperone chaperone = OpenVR.Chaperone; if (chaperone != null) { chaperone.GetPlayAreaSize(ref PlayspaceBounds.x, ref PlayspaceBounds.z); PlayspaceBounds.y = 1; } if (initOpenVR) { OpenVR.Shutdown(); } return(PlayspaceBounds); }
// Use this for initialization void Start() { if (OpenVR.IsHmdPresent()) { CVRChaperone chap = OpenVR.Chaperone; float w = 0.0f; float l = 0.0f; chap.GetPlayAreaSize(ref w, ref l); this.transform.localScale = new Vector3(w * 0.1f, 1.0f, l * 0.1f); Material mat = this.gameObject.GetComponent <Renderer>().material; mat.mainTextureScale = new Vector2(Mathf.Round(w * 5.0f), Mathf.Round(l * 5.0f)); } else { Debug.Log("Can't initialize checkered floor pattern. Starting without it."); } }
private IEnumerator Start() { CVRChaperone chaperone = OpenVR.Chaperone; if (chaperone == null) { Debug.LogWarning("Failed to get IVRChaperone interface."); this.initialized = true; yield break; } float px; float pz; for (;;) { px = 0f; pz = 0f; if (chaperone.GetPlayAreaSize(ref px, ref pz)) { break; } yield return(null); } this.initialized = true; this.playAreaSizeX = px; this.playAreaSizeZ = pz; this.roomscale = (Mathf.Max(px, pz) > 1.01f); Debug.LogFormat("ChaperoneInfo initialized. {2} play area {0:0.00}m x {1:0.00}m", new object[] { px, pz, (!this.roomscale) ? "Standing" : "Roomscale" }); ChaperoneInfo.Initialized.Send(); yield break; yield break; }
// Token: 0x060021ED RID: 8685 RVA: 0x000A7B6A File Offset: 0x000A5D6A private IEnumerator Start() { CVRChaperone chaperone = OpenVR.Chaperone; if (chaperone == null) { Debug.LogWarning("Failed to get IVRChaperone interface."); this.initialized = true; yield break; } float num; float num2; for (;;) { num = 0f; num2 = 0f; if (chaperone.GetPlayAreaSize(ref num, ref num2)) { break; } yield return(null); } this.initialized = true; this.playAreaSizeX = num; this.playAreaSizeZ = num2; this.roomscale = (Mathf.Max(num, num2) > 1.01f); Debug.LogFormat("ChaperoneInfo initialized. {2} play area {0:0.00}m x {1:0.00}m", new object[] { num, num2, this.roomscale ? "Roomscale" : "Standing" }); ChaperoneInfo.Initialized.Send(); yield break; yield break; }