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

            return(a - delta * alpha);
        }
예제 #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);
 }
예제 #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));
 }
예제 #4
0
 public CubicBezier(Vector2d_simple a, Vector2d_simple b)
 {
     m_a = Vector2d_simple.ClampInOne(a);
     m_b = Vector2d_simple.ClampInOne(b);
 }