Nice little piece of code found here
public static float DistanceToLine(Ray ray, Vector3 point)
{
return Vector3.Cross(ray.direction, point - ray.origin).magnitude;
}
Nice little piece of code found here public static float DistanceToLine(Ray ray, Vector3 point) { return Vector3.Cross(ray.direction, point – ray.origin).magnitude; }
Nice little piece of code found here
public static float DistanceToLine(Ray ray, Vector3 point)
{
return Vector3.Cross(ray.direction, point - ray.origin).magnitude;
}
Subscribe to get the latest posts sent to your email.
Leave a comment