Barycentric() public static method

public static Barycentric ( float value1, float value2, float value3, float amount1, float amount2 ) : float
value1 float
value2 float
value3 float
amount1 float
amount2 float
return float
Esempio n. 1
0
 /// <summary>
 /// Creates a new <see cref="Vector2"/> 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 Vector2 value1,
     ref Vector2 value2,
     ref Vector2 value3,
     float amount1,
     float amount2,
     out Vector2 result
     )
 {
     result.X = MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2);
     result.Y = MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2);
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a new <see cref="Vector2"/> 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 Vector2 Barycentric(
     Vector2 value1,
     Vector2 value2,
     Vector2 value3,
     float amount1,
     float amount2
     )
 {
     return(new Vector2(
                MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
                MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2)
                ));
 }
Esempio n. 3
0
        public static void Barycentric(ref Vector4 value1, ref Vector4 value2, ref Vector4 value3, float amount1, float amount2, out Vector4 result)
        {
#if (USE_FARSEER)
            result = new Vector4(
                SilverSpriteMathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
                SilverSpriteMathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2),
                SilverSpriteMathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2),
                SilverSpriteMathHelper.Barycentric(value1.W, value2.W, value3.W, amount1, amount2));
#else
            result = new Vector4(
                MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
                MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2),
                MathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2),
                MathHelper.Barycentric(value1.W, value2.W, value3.W, amount1, amount2));
#endif
        }
Esempio n. 4
0
        public static Vector4 Barycentric(Vector4 value1, Vector4 value2, Vector4 value3, float amount1, float amount2)
        {
#if (USE_FARSEER)
            return(new Vector4(
                       SilverSpriteMathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
                       SilverSpriteMathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2),
                       SilverSpriteMathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2),
                       SilverSpriteMathHelper.Barycentric(value1.W, value2.W, value3.W, amount1, amount2)));
#else
            return(new Vector4(
                       MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
                       MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2),
                       MathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2),
                       MathHelper.Barycentric(value1.W, value2.W, value3.W, amount1, amount2)));
#endif
        }
Esempio n. 5
0
 public static void Barycentric(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, FP amount1, FP amount2, out Vector3 result)
 {
     result = new Vector3(MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2), MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2), MathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2));
 }
Esempio n. 6
0
 public static Vector3 Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, FP amount1, FP amount2)
 {
     return(new Vector3(MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2), MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2), MathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2)));
 }
Esempio n. 7
0
 public static void Barycentric(ref Vector4 value1, ref Vector4 value2, ref Vector4 value3, float amount1, float amount2, out Vector4 result)
 {
     result = new Vector4(MathHelper.Barycentric(value1.X, value2.X, value3.X, amount1, amount2), MathHelper.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2), MathHelper.Barycentric(value1.Z, value2.Z, value3.Z, amount1, amount2), MathHelper.Barycentric(value1.W, value2.W, value3.W, amount1, amount2));
 }