메소드 | 설명 | |
---|---|---|
distanceBetweenPointAndLineSegment ( Vector2 &point, Vector2 &start, Vector2 &end ) : float | ||
lineIntersect ( Vector2 p1, Vector2 p2, Vector2 q1, Vector2 q2 ) : Vector2 | ||
lineIntersect ( Vector2 &point1, Vector2 &point2, Vector2 &point3, Vector2 &point4, Vector2 &intersectionPoint ) : bool |
This method detects if two line segments intersect, and, if so, the point of intersection. Note: If two line segments are coincident, then no intersection is detected (there are actually infinite intersection points).
|
|
lineIntersect ( Vector2 &point1, Vector2 &point2, Vector2 &point3, Vector2 &point4, bool firstIsSegment, bool secondIsSegment, Vector2 &point ) : bool |
This method detects if two line segments (or lines) intersect, and, if so, the point of intersection. Use the firstIsSegment and secondIsSegment parameters to set whether the intersection point must be on the first and second line segments. Setting these both to true means you are doing a line-segment to line-segment intersection. Setting one of them to true means you are doing a line to line-segment intersection test, and so on. Note: If two line segments are coincident, then no intersection is detected (there are actually infinite intersection points). Author: Jeremy Bell
|
|
lineIntersect2 ( Vector2 &a0, Vector2 &a1, Vector2 &b0, Vector2 &b1, Vector2 &intersectionPoint ) : bool |
Check if the lines a0->a1 and b0->b1 cross. If they do, intersectionPoint will be filled with the point of crossing. Grazing lines should not return true.
|
|
lineSegmentAABBIntersect ( Vector2 &point1, Vector2 &point2, |
Get all intersections between a line segment and an AABB.
|
|
lineSegmentVerticesIntersect ( Vector2 &point1, Vector2 &point2, Vertices vertices ) : Vertices |
Get all intersections between a line segment and a list of vertices representing a polygon. The vertices reuse adjacent points, so for example edges one and two are between the first and second vertices and between the second and third vertices. The last edge is between vertex vertices.Count - 1 and verts0. (ie, vertices from a Geometry or AABB)
|
public static distanceBetweenPointAndLineSegment ( Vector2 &point, Vector2 &start, Vector2 &end ) : float | ||
point | Vector2 | |
start | Vector2 | |
end | Vector2 | |
리턴 | float |
public static lineIntersect ( Vector2 p1, Vector2 p2, Vector2 q1, Vector2 q2 ) : Vector2 | ||
p1 | Vector2 | |
p2 | Vector2 | |
q1 | Vector2 | |
q2 | Vector2 | |
리턴 | Vector2 |
public static lineIntersect ( Vector2 &point1, Vector2 &point2, Vector2 &point3, Vector2 &point4, Vector2 &intersectionPoint ) : bool | ||
point1 | Vector2 | The first point of the first line segment. |
point2 | Vector2 | The second point of the first line segment. |
point3 | Vector2 | The first point of the second line segment. |
point4 | Vector2 | The second point of the second line segment. |
intersectionPoint | Vector2 | This is set to the intersection /// point if an intersection is detected. |
리턴 | bool |
public static lineIntersect ( Vector2 &point1, Vector2 &point2, Vector2 &point3, Vector2 &point4, bool firstIsSegment, bool secondIsSegment, Vector2 &point ) : bool | ||
point1 | Vector2 | The first point of the first line segment. |
point2 | Vector2 | The second point of the first line segment. |
point3 | Vector2 | The first point of the second line segment. |
point4 | Vector2 | The second point of the second line segment. |
firstIsSegment | bool | Set this to true to require that the /// intersection point be on the first line segment. |
secondIsSegment | bool | Set this to true to require that the /// intersection point be on the second line segment. |
point | Vector2 | This is set to the intersection /// point if an intersection is detected. |
리턴 | bool |
public static lineIntersect2 ( Vector2 &a0, Vector2 &a1, Vector2 &b0, Vector2 &b1, Vector2 &intersectionPoint ) : bool | ||
a0 | Vector2 | |
a1 | Vector2 | |
b0 | Vector2 | |
b1 | Vector2 | |
intersectionPoint | Vector2 | |
리턴 | bool |
public static lineSegmentAABBIntersect ( Vector2 &point1, Vector2 &point2, |
||
point1 | Vector2 | The first point of the line segment to test |
point2 | Vector2 | The second point of the line segment to test. |
aabb | The AABB that is used for testing intersection. | |
리턴 | Vertices |
public static lineSegmentVerticesIntersect ( Vector2 &point1, Vector2 &point2, Vertices vertices ) : Vertices | ||
point1 | Vector2 | The first point of the line segment to test |
point2 | Vector2 | The second point of the line segment to test. |
vertices | Vertices | The vertices, as described above |
리턴 | Vertices |