Пример #1
0
 /// <summary>
 /// Returns a distance to the closest point on the line
 /// </summary>
 public static float PointLine(Vector3 point, Line3 line)
 {
     return(Vector3.Distance(point, Closest.PointLine(point, line)));
 }
Пример #2
0
 /// <summary>
 /// Returns the distance between the closest points on the line and the sphere
 /// </summary>
 public static float LineSphere(Line3 line, Sphere sphere)
 {
     return(LineSphere(line.origin, line.direction, sphere.center, sphere.radius));
 }
Пример #3
0
 /// <summary>
 /// Finds closest points on the line and the sphere
 /// </summary>
 public static void LineSphere(Line3 line, Sphere sphere, out Vector3 linePoint, out Vector3 spherePoint)
 {
     LineSphere(line.origin, line.direction, sphere.center, sphere.radius, out linePoint, out spherePoint);
 }
Пример #4
0
 /// <summary>
 /// Projects the point onto the line
 /// </summary>
 /// <param name="projectedX">Position of the projected point on the line relative to the origin</param>
 public static Vector3 PointLine(Vector3 point, Line3 line, out float projectedX)
 {
     return(PointLine(point, line.origin, line.direction, out projectedX));
 }
Пример #5
0
 /// <summary>
 /// Returns a distance to the closest point on the line
 /// </summary>
 public static float PointLine(Vector3 point, Line3 line)
 {
     return(Vector3.Distance(point, Geometry.ClosestPointOnLine(point, line)));
 }
Пример #6
0
 /// <summary>
 /// Computes an intersection of the lines
 /// </summary>
 public static bool LineLine(Line3 lineA, Line3 lineB)
 {
     return(LineLine(lineA.origin, lineA.direction, lineB.origin, lineB.direction, out Vector3 intersection));
 }
Пример #7
0
 /// <summary>
 /// Computes an intersection of the line and the sphere
 /// </summary>
 public static bool LineSphere(Line3 line, Sphere sphere, out IntersectionLineSphere intersection)
 {
     return(LineSphere(line.origin, line.direction, sphere.center, sphere.radius, out intersection));
 }
Пример #8
0
 /// <summary>
 /// Tests if the point lies on the line
 /// </summary>
 public static bool PointLine(Vector3 point, Line3 line)
 {
     return(PointLine(point, line.origin, line.direction));
 }
 /// <summary>
 /// Computes an intersection of the line and the sphere
 /// </summary>
 public static bool LineSphere(Line3 line, Sphere sphere, out Vector3 pointA, out Vector3 pointB)
 {
     return(LineSphere(line.origin, line.direction, sphere.center, sphere.radius, out pointA, out pointB));
 }