Exemple #1
0
        /// <summary>
        /// Configures this <see cref="Camera"/> to use perspective projection.
        /// </summary>
        /// <param name="aspectRatio">The aspect ratio between horizontal and vertical. (optional)</param>
        /// <param name="yfov">The vertical field of view, in radians.</param>
        /// <param name="znear">Distance to the near pane in the Z axis.</param>
        /// <param name="zfar">Distance to the far plane in the Z axis.</param>
        public void SetPerspectiveMode(float?aspectRatio, float yfov, float znear, float zfar)
        {
            CameraPerspective.VerifyParameters(aspectRatio, yfov, znear, zfar);

            this._orthographic = null;
            this._perspective  = new CameraPerspective(aspectRatio, yfov, znear, zfar);

            this._type = CameraType.perspective;
        }
Exemple #2
0
        protected override void DeserializeProperty(string jsonPropertyName, JsonReader reader)
        {
            switch (jsonPropertyName)
            {
            case "orthographic": _orthographic = DeserializePropertyValue <CameraOrthographic>(reader); break;

            case "perspective": _perspective = DeserializePropertyValue <CameraPerspective>(reader); break;

            case "type": _type = DeserializePropertyValue <CameraType>(reader); break;

            default: base.DeserializeProperty(jsonPropertyName, reader); break;
            }
        }