Exemple #1
0
 /// <summary>
 /// Creates a new <see cref="Vector2D"/> that contains CatmullRom interpolation of the specified vectors.
 /// </summary>
 /// <param name="value1">The first vector in interpolation.</param>
 /// <param name="value2">The second vector in interpolation.</param>
 /// <param name="value3">The third vector in interpolation.</param>
 /// <param name="value4">The fourth vector in interpolation.</param>
 /// <param name="amount">Weighting factor.</param>
 /// <param name="result">The result of CatmullRom interpolation as an output parameter.</param>
 public static void CatmullRom(
     ref Vector2D value1,
     ref Vector2D value2,
     ref Vector2D value3,
     ref Vector2D value4,
     double amount,
     out Vector2D result
     )
 {
     result.X = MathHelperD.CatmullRom(value1.X, value2.X, value3.X, value4.X, amount);
     result.Y = MathHelperD.CatmullRom(value1.Y, value2.Y, value3.Y, value4.Y, amount);
 }
Exemple #2
0
 /// <summary>
 /// Creates a new <see cref="Vector2D"/> that contains CatmullRom interpolation of the specified vectors.
 /// </summary>
 /// <param name="value1">The first vector in interpolation.</param>
 /// <param name="value2">The second vector in interpolation.</param>
 /// <param name="value3">The third vector in interpolation.</param>
 /// <param name="value4">The fourth vector in interpolation.</param>
 /// <param name="amount">Weighting factor.</param>
 /// <returns>The result of CatmullRom interpolation.</returns>
 public static Vector2D CatmullRom(
     Vector2D value1,
     Vector2D value2,
     Vector2D value3,
     Vector2D value4,
     double amount
     )
 {
     return(new Vector2D(
                MathHelperD.CatmullRom(value1.X, value2.X, value3.X, value4.X, amount),
                MathHelperD.CatmullRom(value1.Y, value2.Y, value3.Y, value4.Y, amount)
                ));
 }