Esempio n. 1
0
        public Rect GetViewport(GvrViewer.Eye eye,
                                GvrViewer.Distortion distortion = GvrViewer.Distortion.Distorted)
        {
            switch (eye)
            {
            case GvrViewer.Eye.Left:
                return(distortion == GvrViewer.Distortion.Distorted ?
                       leftEyeDistortedViewport : leftEyeUndistortedViewport);

            case GvrViewer.Eye.Right:
                return(distortion == GvrViewer.Distortion.Distorted ?
                       rightEyeDistortedViewport : rightEyeUndistortedViewport);

            default:
                return(new Rect());
            }
        }
Esempio n. 2
0
        public Matrix4x4 GetProjection(GvrViewer.Eye eye,
                                       GvrViewer.Distortion distortion = GvrViewer.Distortion.Distorted)
        {
            switch (eye)
            {
            case GvrViewer.Eye.Left:
                return(distortion == GvrViewer.Distortion.Distorted ?
                       leftEyeDistortedProjection : leftEyeUndistortedProjection);

            case GvrViewer.Eye.Right:
                return(distortion == GvrViewer.Distortion.Distorted ?
                       rightEyeDistortedProjection : rightEyeUndistortedProjection);

            default:
                return(Matrix4x4.identity);
            }
        }