protected override double[] InterpolateValueCore(double[] baseValue, double keyFrameProgress)
        {
            if (MathHelper.IsVerySmall(keyFrameProgress))
            {
                return(baseValue);
            }

            if (MathHelper.AreClose(keyFrameProgress, 1))
            {
                return(Numbers);
            }

            var splineProgress = KeySpline.GetSplineProgress(keyFrameProgress);

            return(AnimationHelper.InterpolateGeometryValue(baseValue, Numbers, splineProgress));
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Interpolates, in a linear fashion, between the previous key frame value and the value of the current key
        ///     frame, using the supplied progress increment.
        /// </summary>
        /// <returns>The output value of this key frame given the specified base value and progress.</returns>
        /// <param name="baseValue">The value to animate from.</param>
        /// <param name="keyFrameProgress">
        ///     A value between 0.0 and 1.0, inclusive, that specifies the percentage of time that has
        ///     elapsed for this key frame.
        /// </param>
        protected override sealed T InterpolateValueCore(T baseValue, double keyFrameProgress)
        {
            // ReSharper disable once CompareOfFloatsByEqualityOperator
            if (keyFrameProgress == 0)
            {
                return(baseValue);
            }
            // ReSharper disable once CompareOfFloatsByEqualityOperator
            if (keyFrameProgress == 1)
            {
                return(Value);
            }
            double splineProgress = KeySpline.GetSplineProgress(keyFrameProgress);

            return(Calculator.Interpolate(baseValue, Value, splineProgress));
        }