public static Vector2d_simple LerpWithoutRange(Vector2d_simple a, Vector2d_simple b, float alpha) { Vector2d_simple delta = a - b; return(a - delta * alpha); }
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); }
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)); }
public CubicBezier(Vector2d_simple a, Vector2d_simple b) { m_a = Vector2d_simple.ClampInOne(a); m_b = Vector2d_simple.ClampInOne(b); }