Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Vector2 Parabola(Vector2 start, Vector2 end, float height, float t)
- {
- Func<float, float> f = x => -4 * height * x * x + 4 * height * x;
- var mid = Vector2.Lerp(start, end, t);
- return new Vector2(mid.x, f(t) + Mathf.Lerp(start.y, end.y, t));
- }
- public static Vector2 Parabola(Vector2 start, Vector2 end, float height, float t)
- {
- Func<float, float> f = x => -4 * height * x * x + 4 * height * x;
- var mid = Vector2.Lerp(start, end, t);
- return new Vector2(mid.x, f(t) + Mathf.Lerp(start.y, end.y, t));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement