Exemplo n.º 1
0
        public void UpdatePoses()
        {
            CVRCompositor compositor = OpenVR.Compositor;

            if (compositor != null)
            {
                compositor.GetLastPoses(this.poses, this.gamePoses);
                SteamVR_Events.NewPoses.Send(this.poses);
                SteamVR_Events.NewPosesApplied.Send();
            }
        }
Exemplo n.º 2
0
        private IEnumerator RenderLoop()
        {
            while (Application.isPlaying)
            {
                yield return(this.waitForEndOfFrame);

                if (!SteamVR_Render.pauseRendering)
                {
                    CVRCompositor compositor = OpenVR.Compositor;
                    if (compositor != null)
                    {
                        if (!compositor.CanRenderScene() || cameras.Length < 1)
                        {
                            continue;
                        }
                        compositor.SetTrackingSpace(SteamVR.settings.trackingSpace);
                        SteamVR_Utils.QueueEventOnRenderThread(201510020);
                        SteamVR.Unity.EventWriteString("[UnityMain] GetNativeTexturePtr - Begin");
                        SteamVR_Camera.GetSceneTexture(this.cameras[0].GetComponent <Camera>()).GetNativeTexturePtr();
                        SteamVR.Unity.EventWriteString("[UnityMain] GetNativeTexturePtr - End");
                        compositor.GetLastPoses(this.poses, this.gamePoses);
                        SteamVR_Events.NewPoses.Send(this.poses);
                        SteamVR_Events.NewPosesApplied.Send();
                    }
                    SteamVR_Overlay instance = SteamVR_Overlay.instance;
                    if (instance != null)
                    {
                        instance.UpdateOverlay();
                    }
                    if (this.CheckExternalCamera())
                    {
                        this.RenderExternalCamera();
                    }
                    SteamVR instance2 = SteamVR.instance;
                    this.RenderEye(instance2, EVREye.Eye_Left);
                    this.RenderEye(instance2, EVREye.Eye_Right);
                    foreach (SteamVR_Camera steamVR_Camera in this.cameras)
                    {
                        steamVR_Camera.transform.localPosition = Vector3.zero;
                        steamVR_Camera.transform.localRotation = Quaternion.identity;
                    }
                    if (this.cameraMask != null)
                    {
                        this.cameraMask.Clear();
                    }
                }
            }
            yield break;
        }