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

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

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

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

        default:
            return(Matrix4x4.identity);
        }
    }