Example #1
0
        private void CameraSave(Camera.CameraType type)
        {
            switch (type)
            {
            case Camera.CameraType.Orthogonal:
            {
                Camera.OrthogonalData data = new Camera.OrthogonalData();

                data.Size = float.Parse(_orthogonalSize.Text);
                data.Near = float.Parse(_orthogonalNear.Text);
                data.Far  = float.Parse(_orthogonalFar.Text);

                _world.Camera.SetType(type, data);
            }
            break;

            case Camera.CameraType.Perspective:
            {
                Camera.PerspectiveData data = new Camera.PerspectiveData();

                data.FOV  = float.Parse(_perspectiveFOV.Text);
                data.Near = float.Parse(_perspectiveNear.Text);
                data.Far  = float.Parse(_perspectiveFar.Text);

                _world.Camera.SetType(type, data);
            }
            break;
            }
        }
Example #2
0
        public static string convertCameraType(Camera.CameraType type)
        {
            switch (type)
            {
            case Camera.CameraType.PERSPECTIVE:
                return("perspective");

            case Camera.CameraType.ORTHOGRAPHIC:
                return("orthographic");

            default:
                throw new System.Exception();
            }
        }