Exemple #1
0
 /// <summary>
 /// Tilt the camera clockwise or counterclockwise
 /// </summary>
 /// <param name="amount">how much to tilt the camera. Can be negative.</param>
 /// <param name="right">Whether to pan clockwise (true) or counterclockwise (false). Defaults to true.</param>
 /// <returns>The current tilt of the camera in degrees.</returns>
 public async Task <double> Tilt(double amount, bool clockwise = true)
 {
     if (!SupportedMotions.HasFlag(CameraMoveType.Tilt))
     {
         throw new NotSupportedException();
     }
     return(await DoTilt(amount, clockwise));
 }
Exemple #2
0
 /// <summary>
 /// Pan the camera left or right
 /// </summary>
 /// <param name="amount">how far to pan the camera. Can be negative.</param>
 /// <param name="right">Whether to pan left (false) or right (true). Defaults to true.</param>
 /// <returns>The current facing direction of the camera in degrees.</returns>
 public async Task <double> Pan(double amount, bool right = true)
 {
     if (!SupportedMotions.HasFlag(CameraMoveType.Pan))
     {
         throw new NotSupportedException();
     }
     return(await DoPan(amount, right));
 }
Exemple #3
0
 /// <summary>
 /// Pitch the camera up or down
 /// </summary>
 /// <param name="amount">how far to pitch the camera. Can be negative.</param>
 /// <param name="right">Whether to pitch up (true) or down (false). Defaults to true.</param>
 /// <returns>The current pitch of the camera in degrees.</returns>
 public async Task <double> Pitch(double amount, bool up = true)
 {
     if (!SupportedMotions.HasFlag(CameraMoveType.Pitch))
     {
         throw new NotSupportedException();
     }
     return(await DoPitch(amount, up));
 }
Exemple #4
0
        /// <summary>
        /// Tilt the camera clockwise or counterclockwise
        /// </summary>
        /// <param name="amount">how much to tilt the camera. Can be negative.</param>
        /// <param name="right">Whether to pan clockwise (true) or counterclockwise (false). Defaults to true.</param>
        /// <returns>The current tilt of the camera in degrees.</returns>
        public async Task <double> Zoom(double amount)
        {
            if (!SupportedMotions.HasFlag(CameraMoveType.Zoom))
            {
                throw new NotSupportedException();
            }

            if (amount < 0 && -amount > State.Zoom)
            { // Floor zoom at 0;
                amount = -State.Zoom;
            }
            else if (amount > 0 && State.Zoom + amount > MaxZoom)
            { // Cap zoom at maxZoom
                amount = MaxZoom - State.Zoom;
            }

            return(await DoZoom(amount));
        }