Example #1
0
 /// <summary>
 /// Animates the orthographic width.
 /// </summary>
 /// <param name="camera">
 /// An orthographic camera.
 /// </param>
 /// <param name="newWidth">
 /// The width to animate to.
 /// </param>
 /// <param name="animationTime">
 /// Animation time in milliseconds
 /// </param>
 public static void AnimateWidth(this OrthographicCameraCore camera, float newWidth, float animationTime)
 {
     if (animationTime > 0)
     {
         camera.AnimateWidth(newWidth, animationTime);
     }
     else
     {
         camera.Width = newWidth;
     }
 }
Example #2
0
        /// <summary>
        /// Resets the specified orthographic camera.
        /// </summary>
        /// <param name="camera">
        /// The camera.
        /// </param>
        public static void Reset(this OrthographicCameraCore camera)
        {
            if (camera == null)
            {
                return;
            }

            camera.Position          = new Vector3(20, 10, 40);
            camera.LookDirection     = new Vector3(-20, -10, -40);
            camera.UpDirection       = new Vector3(0, 1, 0);
            camera.Width             = 40;
            camera.NearPlaneDistance = 0.1f;
            camera.FarPlaneDistance  = 1000;
        }