Esempio n. 1
0
 /// <summary>
 /// Creates a new <see cref="Vector2f"/> that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 2d-triangle.
 /// </summary>
 /// <param name="value1">The first vector of 2d-triangle.</param>
 /// <param name="value2">The second vector of 2d-triangle.</param>
 /// <param name="value3">The third vector of 2d-triangle.</param>
 /// <param name="amount1">Barycentric scalar <c>b2</c> which represents a weighting factor towards second vector of 2d-triangle.</param>
 /// <param name="amount2">Barycentric scalar <c>b3</c> which represents a weighting factor towards third vector of 2d-triangle.</param>
 /// <param name="result">The cartesian translation of barycentric coordinates as an output parameter.</param>
 public static void Barycentric(ref Vector2f value1, ref Vector2f value2, ref Vector2f value3, float amount1, float amount2, out Vector2f result)
 {
     result.X = Maths.Barycentric(value1.X, value2.X, value3.X, amount1, amount2);
     result.Y = Maths.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2);
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a new <see cref="Vector2f"/> that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 2d-triangle.
 /// </summary>
 /// <param name="value1">The first vector of 2d-triangle.</param>
 /// <param name="value2">The second vector of 2d-triangle.</param>
 /// <param name="value3">The third vector of 2d-triangle.</param>
 /// <param name="amount1">Barycentric scalar <c>b2</c> which represents a weighting factor towards second vector of 2d-triangle.</param>
 /// <param name="amount2">Barycentric scalar <c>b3</c> which represents a weighting factor towards third vector of 2d-triangle.</param>
 /// <returns>The cartesian translation of barycentric coordinates.</returns>
 public static Vector2f Barycentric(Vector2f value1, Vector2f value2, Vector2f value3, float amount1, float amount2)
 {
     return(new Vector2f(
                Maths.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
                Maths.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2)));
 }