Exemple #1
0
 void Update()
 {
     if (Time.time <= 1)
     {
         ball.transform.position = trajectory.Lerp(Time.time).ToVector();
     }
     else
     {
         ball.transform.position += trajectory.Reflect(TMath.Cross(plane.v, plane.u)).ToVector() * Time.deltaTime * 15;
     }
 }
Exemple #2
0
    public float IntersectsAt(PlaneMath plane)
    {
        Coords N  = TMath.Cross(plane.u, plane.v);
        Coords AB = plane.A - A;

        if (TMath.Dot(N, v) == 0)
        {
            return(float.NaN);
        }

        float t = TMath.Dot(N, AB) / TMath.Dot(N, v);

        return(t);
    }