// Update is called once per frame void Update() { if (Time.time <= 1) { ball.transform.position = trajectory.Lerp(Time.time).ToVector(); } else { ball.transform.position += trajectory.Reflect(HolisticMath.CrossProduct(wall.v, wall.u)).ToVector() * Time.deltaTime * 10; } }
public float IntersectsAt(Plane plane) { Coords normal = HolisticMath.CrossProduct(plane.u, plane.v); if (HolisticMath.Dot(normal, V) == 0) { return(float.NaN); } float t = HolisticMath.Dot(normal, plane.A - A) / HolisticMath.Dot(normal, V); return(t); }