コード例 #1
0
 /// <summary>Returns whether or not a ray and a line intersect</summary>
 public static bool RayLine(Ray2D ray, Line2D line) => RayLine(ray.origin, ray.dir, line.origin, line.dir);
コード例 #2
0
 /// <summary>Returns the intersection point of a ray and an infinite line (if there is one)</summary>
 /// <param name="intersectionPoint">The point at which they intersect</param>
 public static bool RayLine(Ray2D ray, Line2D line, out Vector2 intersectionPoint) => RayLine(ray.origin, ray.dir, line.origin, line.dir, out intersectionPoint);
コード例 #3
0
 /// <summary>Returns whether or not an infinite line and a circle intersect</summary>
 public static bool LineCircle(Line2D line, Circle circle) => GetLineCircleIntersectionState(line.origin, line.dir, circle.center, circle.radius);
コード例 #4
0
 /// <summary>Returns the points at which an infinite line and a circle intersect (if they exist)</summary>
 public static bool LineCircle(Line2D line, Circle circle, out Vector2 intsctPtA, out Vector2 intsctPtB) => GetLineCircleIntersectionPointsUnfiltered(line.origin, line.dir, circle.center, circle.radius, out intsctPtA, out intsctPtB) > 0;
コード例 #5
0
 /// <summary>Returns the intersection point of two infinite lines (if there is one)</summary>
 /// <param name="intersectionPoint">The point at which they intersect</param>
 public static bool Lines(Line2D a, Line2D b, out Vector2 intersectionPoint) => Lines(a.origin, a.dir, b.origin, b.dir, out intersectionPoint);
コード例 #6
0
 /// <summary>Returns whether or not a line segment and a line intersect</summary>
 public static bool LineSegmentLine(LineSegment2D lineSegment, Line2D line) => GetLineLineTValue(line.origin - lineSegment.start, lineSegment.end - lineSegment.start, line.dir, out float tA) && BoundsTestLineSegment(tA);
コード例 #7
0
 /// <summary>Returns the intersection point of a line segment and a line (if there is one)</summary>
 /// <param name="intersectionPoint">The point at which they intersect</param>
 public static bool LineSegmentLine(LineSegment2D lineSegment, Line2D line, out Vector2 intersectionPoint) => LineSegmentLine(lineSegment.start, lineSegment.end, line.origin, line.dir, out intersectionPoint);