Example #1
0
        /// <summary>
        /// This copies the behavior of the standard
        /// <see cref="PCamera.AnimateViewToMatrix">AnimateViewToMatrix</see> but clears the cache
        /// when it is done.
        /// </summary>
        /// <param name="destination">The final matrix value.</param>
        /// <param name="duration">The amount of time that the animation should take.</param>
        /// <returns>
        /// The newly scheduled activity, if the duration is greater than 0; else null.
        /// </returns>
        protected PTransformActivity AnimateStaticViewToTransformFast(Matrix destination, long duration)
        {
            if (duration == 0)
            {
                this.ViewMatrix = destination;
                return(null);
            }

            PTransformActivity ta = new FastTransformActivity(this, duration, PUtil.DEFAULT_ACTIVITY_STEP_RATE, new PCamera.PCameraTransformTarget(this), destination);

            PRoot r = Root;

            if (r != null)
            {
                r.ActivityScheduler.AddActivity(ta);
            }

            return(ta);
        }
Example #2
0
		/// <summary>
		/// This copies the behavior of the standard
		/// <see cref="PCamera.AnimateViewToMatrix">AnimateViewToMatrix</see> but clears the cache
		/// when it is done.
		/// </summary>
		/// <param name="destination">The final matrix value.</param>
		/// <param name="duration">The amount of time that the animation should take.</param>
		/// <returns>
		/// The newly scheduled activity, if the duration is greater than 0; else null.
		/// </returns>
		protected PTransformActivity AnimateStaticViewToTransformFast(PMatrix destination, long duration) {
			if (duration == 0) {
				this.ViewMatrix = destination;
				return null;
			}

			PTransformActivity ta = new FastTransformActivity(this, duration, PUtil.DEFAULT_ACTIVITY_STEP_RATE, new PCamera.PCameraTransformTarget(this), destination);
		
			PRoot r = Root;
			if (r != null) {
				r.ActivityScheduler.AddActivity(ta);
			}
	
			return ta;
		}