Exemple #1
0
 /// <summary>
 /// Rotate between two parametrics (the magnitude of the resulting vector is the magnitude of the <paramref name="from"/> vector), closing <paramref name="rate"/> degrees of the gap per second.
 /// <para>This function uses the last returned value as its rotation source, only sampling the source parametric once.</para>
 /// </summary>
 /// <param name="rate">Degrees of gap to close per second</param>
 /// <param name="from">Source parametric</param>
 /// <param name="to">Target parametric</param>
 /// <returns></returns>
 public static ExTP TrueRotateLerpRate(ExBPY rate, ExTP from, ExTP to)
 {
     return(bpi => ExMHelpers.RotateLerp(to(bpi), from(bpi), bpi, true, true, rate(bpi)));
 }
Exemple #2
0
 /// <summary>
 /// Rotate between two parametrics (the magnitude of the resulting vector is the magnitude of the <paramref name="from"/> vector), closing <paramref name="ratio"/> fraction of the gap per second.
 /// <para>This function uses the last returned value as its rotation source, only sampling the source parametric once.</para>
 /// </summary>
 /// <remarks>
 /// Ratio is not multiplicative as in RotateLerpPercent. Instead, it accumulates like the function 1-e^-rt.
 /// This means that the rotation is faster during the first second than the second second, and so on.
 /// Use TrueRotateLerpRate for constant rotation rates.
 /// </remarks>
 /// <param name="ratio">Fraction of gap to close per second</param>
 /// <param name="from">Source parametric</param>
 /// <param name="to">Target parametric</param>
 /// <returns></returns>
 public static ExTP TrueRotateLerpPercent(ExBPY ratio, ExTP from, ExTP to)
 {
     return(bpi => ExMHelpers.RotateLerp(to(bpi), from(bpi), bpi, false, true, ratio(bpi)));
 }