/// <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));
 }
        /// <summary>
        /// Computes an intersection of the lines
        /// </summary>
        public static bool LineLine(Line3 lineA, Line3 lineB)
        {
            Vector3 intersection;

            return(LineLine(lineA.origin, lineA.direction, lineB.origin, lineB.direction, out intersection));
        }
 /// <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));
 }
Пример #4
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));
 }
Пример #5
0
 /// <summary>
 /// Returns a distance to the closest point on the line
 /// </summary>
 public static float PointLine(Vector3 point, Line3 line)
 {
     return(point.DistanceTo(Closest.PointLine(point, line)));
 }
Пример #6
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));
 }
Пример #7
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);
 }