Exemple #1
0
        public static Vector2d_simple LerpWithoutRange(Vector2d_simple a, Vector2d_simple b, float alpha)
        {
            Vector2d_simple delta = a - b;

            return(a - delta * alpha);
        }
Exemple #2
0
 public static Vector2d_simple ClampInOne(Vector2d_simple p)
 {
     p.x = p.x <= 0 ? 0 : (p.x >= 1 ? 1 : p.x);
     //p.y = p.y <= 0 ? 0 : (p.y >= 1 ? 1 : p.y);
     return(p);
 }
Exemple #3
0
 public static Vector2d_simple LerpInRange(Vector2d_simple a, Vector2d_simple b, float alpha)
 {
     alpha = alpha < 0 ? 0 : (alpha > 1 ? 1 : alpha);
     return(LerpWithoutRange(a, b, alpha));
 }
Exemple #4
0
 public CubicBezier(Vector2d_simple a, Vector2d_simple b)
 {
     m_a = Vector2d_simple.ClampInOne(a);
     m_b = Vector2d_simple.ClampInOne(b);
 }