コード例 #1
0
 // 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;
     }
 }
コード例 #2
0
    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);
    }