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

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

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

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

            default:
                return(Matrix4x4.identity);
            }
        }