#include <math.h>
Public Types | |
| enum | IntersectionResult { PARALLEL, COINCIDENT, NOT_INTERSECTING, INTERSECTING } |
| Possible return values of computing intersection of 2 lines. More... | |
Public Member Functions | |
| Line (const Vector &vStart, const Vector &vEnd) | |
| Constructor, based on start and end points. More... | |
| float | RangeFrom (const Vector &vPoint) |
| Returns the shortest distance between a given point and this line. More... | |
| IntersectionResult | Intersection2D (const Line &cOther, Vector &vResult, bool bSegmentOnly=false) |
| Calculates intersection of 2 lines in 2D. More... | |
| enum IntersectionResult |
Possible return values of computing intersection of 2 lines.
| Enumerator | |
|---|---|
| PARALLEL | |
| COINCIDENT | |
| NOT_INTERSECTING | |
| INTERSECTING | |
| float RangeFrom | ( | const Vector & | vPoint | ) |
Returns the shortest distance between a given point and this line.
Note: The line is not logically extended to infinity in this function. Only points between the start and end point are considered part of the line.
| IntersectionResult Intersection2D | ( | const Line & | cOther, |
| Vector & | vResult, | ||
| bool | bSegmentOnly = false |
||
| ) |
Calculates intersection of 2 lines in 2D.
If bSegmentOnly is true it will only result the intersection point if it is between the segment endpoints, otherwise the result apply to whole lines.