Exemplo n.º 1
0
    private void Update()
    {
        ray1.direction = ray1.direction.NormalizeSafe();
        ray2.direction = ray2.direction.NormalizeSafe();
        var intersectionLine = ray1.IntersectRay(ray2);

        Debug.DrawRay(ray1.origin.ToVector3(), (ray1.direction * 10).ToVector3(), Color.green);
        Debug.DrawRay(ray2.origin.ToVector3(), (ray2.direction * 10).ToVector3(), Color.red);
        Debug.DrawLine(intersectionLine.point1.ToVector3(), intersectionLine.point2.ToVector3(), Color.blue);
    }