/// <summary> /// Creates a new <see cref="Vector2f"/> that contains linear interpolation of the specified vectors. /// Uses <see cref="Maths.LerpPrecise"/> on MathHelper for the interpolation. /// Less efficient but more precise compared to <see cref="Vector2f.Lerp(ref Vector2f, ref Vector2f, float, out Vector2f)"/>. /// See remarks section of <see cref="Maths.LerpPrecise"/> on MathHelper for more info. /// </summary> /// <param name="value1">The first vector.</param> /// <param name="value2">The second vector.</param> /// <param name="amount">Weighting value(between 0.0 and 1.0).</param> /// <param name="result">The result of linear interpolation of the specified vectors as an output parameter.</param> public static void LerpPrecise(ref Vector2f value1, ref Vector2f value2, float amount, out Vector2f result) { result.X = Maths.LerpPrecise(value1.X, value2.X, amount); result.Y = Maths.LerpPrecise(value1.Y, value2.Y, amount); }
/// <summary> /// Creates a new <see cref="Vector2f"/> that contains linear interpolation of the specified vectors. /// Uses <see cref="Maths.LerpPrecise"/> on MathHelper for the interpolation. /// Less efficient but more precise compared to <see cref="Vector2f.Lerp(Vector2f, Vector2f, float)"/>. /// See remarks section of <see cref="Maths.LerpPrecise"/> on MathHelper for more info. /// </summary> /// <param name="value1">The first vector.</param> /// <param name="value2">The second vector.</param> /// <param name="amount">Weighting value(between 0.0 and 1.0).</param> /// <returns>The result of linear interpolation of the specified vectors.</returns> public static Vector2f LerpPrecise(Vector2f value1, Vector2f value2, float amount) { return(new Vector2f( Maths.LerpPrecise(value1.X, value2.X, amount), Maths.LerpPrecise(value1.Y, value2.Y, amount))); }