示例#1
0
    // Token: 0x0600006B RID: 107 RVA: 0x00004F18 File Offset: 0x00003118
    private void OnDisable()
    {
        bool flag = this.cameras != null;

        if (flag)
        {
            int num = this.cameras.Length;
            for (int i = 0; i < num; i++)
            {
                global::UnityEngine.Camera camera = this.cameras[i];
                bool flag2 = camera != null;
                if (flag2)
                {
                    camera.rect = this.cameraRects[i];
                }
            }
            this.cameras     = null;
            this.cameraRects = null;
        }
        bool flag3 = this.config.sceneResolutionScale > 0f;

        if (flag3)
        {
            global::SteamVR_Camera.sceneResolutionScale = this.sceneResolutionScale;
        }
    }
示例#2
0
        // Token: 0x060002E6 RID: 742 RVA: 0x0001115C File Offset: 0x0000F35C
        protected virtual global::VRGIN.Core.CameraJudgement JudgeCameraInternal(global::UnityEngine.Camera camera)
        {
            bool flag  = global::VRGIN.Core.VR.GUI.IsInterested(camera);
            bool flag2 = camera.targetTexture == null;

            global::VRGIN.Core.CameraJudgement result;
            if (flag2)
            {
                bool flag3 = flag;
                if (flag3)
                {
                    result = global::VRGIN.Core.CameraJudgement.GUIAndCamera;
                }
                else
                {
                    bool flag4 = camera.CompareTag("MainCamera");
                    if (flag4)
                    {
                        result = global::VRGIN.Core.CameraJudgement.MainCamera;
                    }
                    else
                    {
                        result = global::VRGIN.Core.CameraJudgement.SubCamera;
                    }
                }
            }
            else
            {
                result = (flag ? global::VRGIN.Core.CameraJudgement.GUI : global::VRGIN.Core.CameraJudgement.Ignore);
            }
            return(result);
        }
示例#3
0
 // Token: 0x06000246 RID: 582 RVA: 0x0000E368 File Offset: 0x0000C568
 protected override void OnAwake()
 {
     global::UnityEngine.GameObject gameObject = global::UnityEngine.GameObject.CreatePrimitive(0);
     gameObject.transform.SetParent(base.transform, false);
     global::UnityEngine.GameObject gameObject2 = global::UnityEngine.GameObject.CreatePrimitive(0);
     gameObject2.transform.SetParent(base.transform, false);
     base.transform.localScale           = 0.3f * global::UnityEngine.Vector3.one;
     base.transform.localScale           = new global::UnityEngine.Vector3(0.2f, 0.2f, 0.4f);
     gameObject.transform.localScale     = global::UnityEngine.Vector3.one * 0.3f;
     gameObject.transform.localPosition  = global::UnityEngine.Vector3.forward * 0.5f;
     gameObject2.transform.localScale    = global::UnityEngine.Vector3.one * 0.3f;
     gameObject2.transform.localPosition = global::UnityEngine.Vector3.up * 0.5f;
     base.GetComponent <global::UnityEngine.Collider>().isTrigger = true;
     this.model = new global::UnityEngine.GameObject("Model").AddComponent <global::SteamVR_RenderModel>();
     this.model.transform.SetParent(global::VRGIN.Core.VR.Camera.SteamCam.head, false);
     this.model.shader = global::VRGIN.Core.VR.Context.Materials.StandardShader;
     this.model.SetDeviceIndex(0);
     this.model.gameObject.layer = global::UnityEngine.LayerMask.NameToLayer(global::VRGIN.Core.VR.Context.InvisibleLayer);
     global::UnityEngine.Camera camera = base.gameObject.AddComponent <global::UnityEngine.Camera>();
     camera.depth            = 1f;
     camera.nearClipPlane    = 0.3f;
     camera.cullingMask      = (int.MaxValue & ~global::VRGIN.Core.VR.Context.UILayerMask);
     base.transform.position = global::VRGIN.Visuals.PlayerCamera.S_Position;
     base.transform.rotation = global::VRGIN.Visuals.PlayerCamera.S_Rotation;
 }
示例#4
0
        // Token: 0x0600034C RID: 844 RVA: 0x00011B9C File Offset: 0x0000FD9C
        protected override void OnAwake()
        {
            base.OnAwake();
            global::UnityEngine.Camera camera = this.Camera;
            bool flag = !camera;

            if (flag)
            {
                global::VRGIN.Core.VRLog.Error("No camera found! {0}", new object[]
                {
                    base.name
                });
                global::UnityEngine.Object.Destroy(this);
            }
            else
            {
                this.nearClipPlane = camera.nearClipPlane;
                this.farClipPlane  = camera.farClipPlane;
                this.clearFlags    = camera.clearFlags;
                this.renderingPath = camera.renderingPath;
                this.clearStencilAfterLightingPass = camera.clearStencilAfterLightingPass;
                this.depthTextureMode    = camera.depthTextureMode;
                this.layerCullDistances  = camera.layerCullDistances;
                this.layerCullSpherical  = camera.layerCullSpherical;
                this.useOcclusionCulling = camera.useOcclusionCulling;
                this.backgroundColor     = camera.backgroundColor;
                this.cullingMask         = camera.cullingMask;
            }
        }
示例#5
0
    // Token: 0x060000B1 RID: 177 RVA: 0x000081F8 File Offset: 0x000063F8
    private void AddInternal(global::SteamVR_Camera vrcam)
    {
        global::UnityEngine.Camera component = vrcam.GetComponent <global::UnityEngine.Camera>();
        int num = this.cameras.Length;

        global::SteamVR_Camera[] array = new global::SteamVR_Camera[num + 1];
        int num2 = 0;

        for (int i = 0; i < num; i++)
        {
            global::UnityEngine.Camera component2 = this.cameras[i].GetComponent <global::UnityEngine.Camera>();
            bool flag = i == num2 && component2.depth > component.depth;
            if (flag)
            {
                array[num2++] = vrcam;
            }
            array[num2++] = this.cameras[i];
        }
        bool flag2 = num2 == num;

        if (flag2)
        {
            array[num2] = vrcam;
        }
        this.cameras = array;
        base.enabled = true;
    }
示例#6
0
    // Token: 0x060000B7 RID: 183 RVA: 0x000083AC File Offset: 0x000065AC
    private void RenderEye(global::SteamVR vr, global::Valve.VR.EVREye eye)
    {
        global::SteamVR_Render.eye = eye;
        bool flag = this.cameraMask != null;

        if (flag)
        {
            this.cameraMask.Set(vr, eye);
        }
        foreach (global::SteamVR_Camera steamVR_Camera in this.cameras)
        {
            steamVR_Camera.transform.localPosition = vr.eyes[(int)eye].pos;
            steamVR_Camera.transform.localRotation = vr.eyes[(int)eye].rot;
            this.cameraMask.transform.position     = steamVR_Camera.transform.position;
            global::UnityEngine.Camera component = steamVR_Camera.GetComponent <global::UnityEngine.Camera>();
            component.targetTexture = global::SteamVR_Camera.GetSceneTexture(component.allowHDR);
            int  cullingMask = component.cullingMask;
            bool flag2       = eye == global::Valve.VR.EVREye.Eye_Left;
            if (flag2)
            {
                component.cullingMask &= ~this.rightMask;
                component.cullingMask |= this.leftMask;
            }
            else
            {
                component.cullingMask &= ~this.leftMask;
                component.cullingMask |= this.rightMask;
            }
            component.Render();
            component.cullingMask = cullingMask;
        }
    }
示例#7
0
 // Token: 0x060000F0 RID: 240 RVA: 0x0000A670 File Offset: 0x00008870
 private void Awake()
 {
     global::UnityEngine.Camera component = base.GetComponent <global::UnityEngine.Camera>();
     component.clearFlags          = 4;
     component.useOcclusionCulling = false;
     component.cullingMask         = 0;
     component.depth = -9999f;
 }
    // Token: 0x0600007B RID: 123 RVA: 0x00005954 File Offset: 0x00003B54
    private void OnPostRender()
    {
        global::SteamVR instance = global::SteamVR.instance;

        global::UnityEngine.Camera component = base.GetComponent <global::UnityEngine.Camera>();
        float num  = this.scale * component.aspect / instance.aspect;
        float num2 = -this.scale;
        float num3 = this.scale;
        float num4 = num;
        float num5 = -num;

        global::UnityEngine.Material blitMaterial = global::SteamVR_Camera.blitMaterial;
        blitMaterial.mainTexture = global::SteamVR_Camera.GetSceneTexture(component.allowHDR);
        global::UnityEngine.GL.PushMatrix();
        global::UnityEngine.GL.LoadOrtho();
        blitMaterial.SetPass(0);
        global::UnityEngine.GL.Begin(7);
        global::UnityEngine.GL.TexCoord2(0f, 0f);
        global::UnityEngine.GL.Vertex3(num2, num4, 0f);
        global::UnityEngine.GL.TexCoord2(1f, 0f);
        global::UnityEngine.GL.Vertex3(num3, num4, 0f);
        global::UnityEngine.GL.TexCoord2(1f, 1f);
        global::UnityEngine.GL.Vertex3(num3, num5, 0f);
        global::UnityEngine.GL.TexCoord2(0f, 1f);
        global::UnityEngine.GL.Vertex3(num2, num5, 0f);
        global::UnityEngine.GL.End();
        global::UnityEngine.GL.PopMatrix();
        global::SteamVR_Overlay instance2 = global::SteamVR_Overlay.instance;
        bool flag = instance2 && instance2.texture && global::SteamVR_GameView.overlayMaterial && this.drawOverlay;

        if (flag)
        {
            global::UnityEngine.Texture texture = instance2.texture;
            global::SteamVR_GameView.overlayMaterial.mainTexture = texture;
            float num6 = 0f;
            float num7 = 1f - (float)global::UnityEngine.Screen.height / (float)texture.height;
            float num8 = (float)global::UnityEngine.Screen.width / (float)texture.width;
            float num9 = 1f;
            global::UnityEngine.GL.PushMatrix();
            global::UnityEngine.GL.LoadOrtho();
            global::SteamVR_GameView.overlayMaterial.SetPass((global::UnityEngine.QualitySettings.activeColorSpace == 1) ? 1 : 0);
            global::UnityEngine.GL.Begin(7);
            global::UnityEngine.GL.TexCoord2(num6, num7);
            global::UnityEngine.GL.Vertex3(-1f, -1f, 0f);
            global::UnityEngine.GL.TexCoord2(num8, num7);
            global::UnityEngine.GL.Vertex3(1f, -1f, 0f);
            global::UnityEngine.GL.TexCoord2(num8, num9);
            global::UnityEngine.GL.Vertex3(1f, 1f, 0f);
            global::UnityEngine.GL.TexCoord2(num6, num9);
            global::UnityEngine.GL.Vertex3(-1f, 1f, 0f);
            global::UnityEngine.GL.End();
            global::UnityEngine.GL.PopMatrix();
        }
    }
示例#9
0
        // Token: 0x060002E5 RID: 741 RVA: 0x00011114 File Offset: 0x0000F314
        public global::VRGIN.Core.CameraJudgement JudgeCamera(global::UnityEngine.Camera camera)
        {
            bool flag = camera.name.Contains("VRGIN") || camera.name == "poseUpdater";

            global::VRGIN.Core.CameraJudgement result;
            if (flag)
            {
                result = global::VRGIN.Core.CameraJudgement.Ignore;
            }
            else
            {
                result = this.JudgeCameraInternal(camera);
            }
            return(result);
        }
示例#10
0
        // Token: 0x06000543 RID: 1347 RVA: 0x0001A934 File Offset: 0x00018B34
        public void OnAssign(global::UnityEngine.Camera camera)
        {
            bool softMode = this._SoftMode;

            if (softMode)
            {
                camera.cullingMask   = 0;
                camera.nearClipPlane = 1f;
                camera.farClipPlane  = 1f;
            }
            else
            {
                camera.enabled = false;
            }
        }
示例#11
0
        // Token: 0x0600039D RID: 925 RVA: 0x000130DC File Offset: 0x000112DC
        public void AddCamera(global::UnityEngine.Camera camera)
        {
            global::VRGIN.Core.VRLog.Info("Trying to find a GUI mapping for camera {0}", new object[]
            {
                camera.name
            });
            global::VRGIN.Core.IScreenGrabber screenGrabber = this.FindCameraMapping(camera);
            bool flag = screenGrabber != null;

            if (flag)
            {
                this._CameraMappings[camera] = screenGrabber;
                screenGrabber.OnAssign(camera);
                global::VRGIN.Core.VRLog.Info("Assigned camera {0} to {1}", new object[]
                {
                    camera.name,
                    screenGrabber
                });
            }
            this._CheckedCameras.Add(camera);
        }
示例#12
0
    // Token: 0x06000043 RID: 67 RVA: 0x00003724 File Offset: 0x00001924
    private void OnPreRender()
    {
        bool flag = this.flip;

        if (flag)
        {
            this.flip.enabled = (global::SteamVR_Render.Top() == this && global::SteamVR.instance.graphicsAPI == global::Valve.VR.EGraphicsAPIConvention.API_DirectX);
        }
        global::UnityEngine.Camera component = this.head.GetComponent <global::UnityEngine.Camera>();
        bool flag2 = component != null;

        if (flag2)
        {
            component.enabled = (global::SteamVR_Render.Top() == this);
        }
        bool flag3 = this.wireframe;

        if (flag3)
        {
            global::UnityEngine.GL.wireframe = true;
        }
    }
示例#13
0
        // Token: 0x0600039F RID: 927 RVA: 0x00013260 File Offset: 0x00011460
        private global::VRGIN.Core.IScreenGrabber FindCameraMapping(global::UnityEngine.Camera camera)
        {
            foreach (global::VRGIN.Core.IScreenGrabber screenGrabber in this._ScreenGrabbers)
            {
                bool flag = screenGrabber.Check(camera);
                if (flag)
                {
                    return(screenGrabber);
                }
            }
            bool flag2 = this.Check(camera);

            global::VRGIN.Core.IScreenGrabber result;
            if (flag2)
            {
                result = this;
            }
            else
            {
                result = null;
            }
            return(result);
        }
示例#14
0
    // Token: 0x0600006A RID: 106 RVA: 0x00004E14 File Offset: 0x00003014
    private void OnEnable()
    {
        this.cameras = global::UnityEngine.Object.FindObjectsOfType <global::UnityEngine.Camera>();
        bool flag = this.cameras != null;

        if (flag)
        {
            int num = this.cameras.Length;
            this.cameraRects = new global::UnityEngine.Rect[num];
            for (int i = 0; i < num; i++)
            {
                global::UnityEngine.Camera camera = this.cameras[i];
                this.cameraRects[i] = camera.rect;
                bool flag2 = camera == this.cam;
                if (!flag2)
                {
                    bool flag3 = camera.targetTexture != null;
                    if (!flag3)
                    {
                        bool flag4 = camera.GetComponent <global::SteamVR_Camera>() != null;
                        if (!flag4)
                        {
                            camera.rect = new global::UnityEngine.Rect(0.5f, 0f, 0.5f, 0.5f);
                        }
                    }
                }
            }
        }
        bool flag5 = this.config.sceneResolutionScale > 0f;

        if (flag5)
        {
            this.sceneResolutionScale = global::SteamVR_Camera.sceneResolutionScale;
            global::SteamVR_Camera.sceneResolutionScale = this.config.sceneResolutionScale;
        }
    }
示例#15
0
    // Token: 0x0600003D RID: 61 RVA: 0x00002E60 File Offset: 0x00001060
    private void OnEnable()
    {
        global::SteamVR instance = global::SteamVR.instance;
        bool            flag     = instance == null;

        if (flag)
        {
            bool flag2 = this.head != null;
            if (flag2)
            {
                this.head.GetComponent <global::SteamVR_GameView>().enabled      = false;
                this.head.GetComponent <global::SteamVR_TrackedObject>().enabled = false;
            }
            bool flag3 = this.flip != null;
            if (flag3)
            {
                this.flip.enabled = false;
            }
            base.enabled = false;
        }
        else
        {
            this.Expand();
            bool flag4 = global::SteamVR_Camera.blitMaterial == null;
            if (flag4)
            {
                global::SteamVR_Camera.blitMaterial = new global::UnityEngine.Material(global::EscalationVR.UnityHelper.GetShader("Custom/SteamVR_Blit"));
            }
            global::UnityEngine.Camera component = base.GetComponent <global::UnityEngine.Camera>();
            component.fieldOfView  = instance.fieldOfView;
            component.aspect       = instance.aspect;
            component.eventMask    = 0;
            component.orthographic = false;
            component.enabled      = false;
            bool flag5 = component.actualRenderingPath != 1 && global::UnityEngine.QualitySettings.antiAliasing > 1;
            if (flag5)
            {
                global::UnityEngine.Debug.LogWarning("MSAA only supported in Forward rendering path. (disabling MSAA)");
                global::UnityEngine.QualitySettings.antiAliasing = 0;
            }
            global::UnityEngine.Camera component2 = this.head.GetComponent <global::UnityEngine.Camera>();
            bool flag6 = component2 != null;
            if (flag6)
            {
                component2.allowHDR      = component.allowHDR;
                component2.renderingPath = component.renderingPath;
            }
            bool flag7 = this.ears == null;
            if (flag7)
            {
                global::SteamVR_Ears componentInChildren = base.transform.GetComponentInChildren <global::SteamVR_Ears>();
                bool flag8 = componentInChildren != null;
                if (flag8)
                {
                    this._ears = componentInChildren.transform;
                }
            }
            bool flag9 = this.ears != null;
            if (flag9)
            {
                this.ears.GetComponent <global::SteamVR_Ears>().vrcam = this;
            }
            global::SteamVR_Render.Add(this);
        }
    }
示例#16
0
 // Token: 0x060002EB RID: 747 RVA: 0x0001121C File Offset: 0x0000F41C
 public virtual bool IsIrrelevantCamera(global::UnityEngine.Camera blueprint)
 {
     return(true);
 }
示例#17
0
 // Token: 0x060002EC RID: 748 RVA: 0x00011230 File Offset: 0x0000F430
 public virtual bool IsUICamera(global::UnityEngine.Camera camera)
 {
     return(camera.GetComponent("UICamera"));
 }
 // Token: 0x06000347 RID: 839 RVA: 0x00011AC7 File Offset: 0x0000FCC7
 public CopiedCameraEventArgs(global::UnityEngine.Camera camera)
 {
     this.Camera = camera;
 }
 // Token: 0x06000346 RID: 838 RVA: 0x00011AAF File Offset: 0x0000FCAF
 public InitializeCameraEventArgs(global::UnityEngine.Camera camera, global::UnityEngine.Camera blueprint)
 {
     this.Camera    = camera;
     this.Blueprint = blueprint;
 }
示例#20
0
 // Token: 0x0600033B RID: 827 RVA: 0x000118FC File Offset: 0x0000FAFC
 public bool Check(global::UnityEngine.Camera camera)
 {
     return(this._Judge(camera));
 }
示例#21
0
 // Token: 0x0600033D RID: 829 RVA: 0x0001192A File Offset: 0x0000FB2A
 public void OnAssign(global::UnityEngine.Camera camera)
 {
 }
示例#22
0
 // Token: 0x060003A0 RID: 928 RVA: 0x000132D8 File Offset: 0x000114D8
 public bool Check(global::UnityEngine.Camera camera)
 {
     return(global::VRGIN.Core.VR.Interpreter.IsUICamera(camera));
 }
示例#23
0
 // Token: 0x0600038C RID: 908 RVA: 0x00012974 File Offset: 0x00010B74
 public bool IsInterested(global::UnityEngine.Camera camera)
 {
     return(this.FindCameraMapping(camera) != null);
 }
示例#24
0
 // Token: 0x060003A2 RID: 930 RVA: 0x00013305 File Offset: 0x00011505
 public void OnAssign(global::UnityEngine.Camera camera)
 {
     this._VRGUICamera.depth = global::UnityEngine.Mathf.Min(this._VRGUICamera.depth, camera.depth - 1f);
 }
示例#25
0
    // Token: 0x06000041 RID: 65 RVA: 0x00003254 File Offset: 0x00001454
    public void Expand()
    {
        global::UnityEngine.Transform transform = base.transform.parent;
        bool flag = transform == null;

        if (flag)
        {
            transform = new global::UnityEngine.GameObject(base.name + " (origin)").transform;
            transform.localPosition = base.transform.localPosition;
            transform.localRotation = base.transform.localRotation;
            transform.localScale    = base.transform.localScale;
        }
        bool flag2 = this.head == null;

        if (flag2)
        {
            this._head = new global::UnityEngine.GameObject(base.name + " (head)", new global::System.Type[]
            {
                typeof(global::SteamVR_GameView),
                typeof(global::SteamVR_TrackedObject)
            }).transform;
            this.head.parent     = transform;
            this.head.position   = base.transform.position;
            this.head.rotation   = base.transform.rotation;
            this.head.localScale = global::UnityEngine.Vector3.one;
            this.head.tag        = base.tag;
            global::UnityEngine.Camera component = this.head.GetComponent <global::UnityEngine.Camera>();
            component.clearFlags          = 4;
            component.cullingMask         = 0;
            component.eventMask           = 0;
            component.orthographic        = true;
            component.orthographicSize    = 1f;
            component.nearClipPlane       = 0f;
            component.farClipPlane        = 1f;
            component.useOcclusionCulling = false;
        }
        bool flag3 = base.transform.parent != this.head;

        if (flag3)
        {
            base.transform.parent        = this.head;
            base.transform.localPosition = global::UnityEngine.Vector3.zero;
            base.transform.localRotation = global::UnityEngine.Quaternion.identity;
            base.transform.localScale    = global::UnityEngine.Vector3.one;
            while (base.transform.childCount > 0)
            {
                base.transform.GetChild(0).parent = this.head;
            }
            global::UnityEngine.GUILayer component2 = base.GetComponent <global::UnityEngine.GUILayer>();
            bool flag4 = component2 != null;
            if (flag4)
            {
                global::UnityEngine.Object.DestroyImmediate(component2);
                this.head.gameObject.AddComponent <global::UnityEngine.GUILayer>();
            }
            global::UnityEngine.AudioListener component3 = base.GetComponent <global::UnityEngine.AudioListener>();
            bool flag5 = component3 != null;
            if (flag5)
            {
                global::UnityEngine.Object.DestroyImmediate(component3);
                this._ears = new global::UnityEngine.GameObject(base.name + " (ears)", new global::System.Type[]
                {
                    typeof(global::SteamVR_Ears)
                }).transform;
                this.ears.parent        = this._head;
                this.ears.localPosition = global::UnityEngine.Vector3.zero;
                this.ears.localRotation = global::UnityEngine.Quaternion.identity;
                this.ears.localScale    = global::UnityEngine.Vector3.one;
            }
        }
        bool flag6 = !base.name.EndsWith(" (eye)");

        if (flag6)
        {
            base.name += " (eye)";
        }
    }
示例#26
0
 // Token: 0x0600038F RID: 911 RVA: 0x000129A4 File Offset: 0x00010BA4
 internal bool Owns(global::UnityEngine.Camera cam)
 {
     return(this._CameraMappings.ContainsKey(cam));
 }
示例#27
0
 // Token: 0x06000541 RID: 1345 RVA: 0x0001A8C4 File Offset: 0x00018AC4
 public bool Check(global::UnityEngine.Camera camera)
 {
     return(!camera.GetComponent("UICamera") && !camera.name.Contains("VR") && camera.targetTexture == null && (!camera.CompareTag("MainCamera") || !this._SpareMainCamera));
 }