2D line segment More...
#include <Nimble/LineSegment2.hpp>
Public Member Functions | |
| Vector2T< T > & | begin () |
| Returns the first end point of the line segment. | |
| const Vector2T< T > & | begin () const |
| Returns the first end point of the line segment. | |
| Vector2T< T > | directionNormalized () const |
| Returns normalized direction of this line segment. | |
| float | distanceInfinite (const Vector2T< T > &point) |
| Calculates the distance between this (infinite) line and a point. More... | |
| Vector2T< T > & | end () |
| Returns the second end point of the line segment. | |
| const Vector2T< T > & | end () const |
| Returns the second end point of the line segment. | |
| bool | intersects (const LineSegment2T &that, Vector2T< T > *point=0) const |
| Returns true if the two line segments intersect. More... | |
| bool | intersectsBezier (Vector2T< T > cp[4]) |
| Returns true if the line segment intersects with the given bezier curve. | |
| bool | intersectsInfinite (const LineSegment2T &that, Vector2T< T > *point) const |
| Tests for intersection with a given line. More... | |
| T | length () const |
| Returns the length of the line segment. | |
| LineSegment2T () | |
| Construct line segment object, without initializing its values. | |
| LineSegment2T (T x1, T y1, T x2, T y2) | |
| Initialize line segment from given coordinate values. | |
| LineSegment2T (const Vector2T< T > &p1, const Vector2T< T > &p2) | |
| Constructs a new line segment between two points. | |
| bool | operator== (const LineSegment2T &that) const |
| Compares the end points of two line segments and returns true if they are equal. | |
| bool | pointMatch (const LineSegment2T &that) const |
| Compares the given point against both end points and returns true if the point is equal to either one. | |
2D line segment
Where lines are of infinite length, line segments have a finite length.
|
inline |
Calculates the distance between this (infinite) line and a point.
| point | 2D point |
|
inline |
Returns true if the two line segments intersect.
| that | line segment to compare | |
| [out] | point | optional intersection point |
|
inline |
Tests for intersection with a given line.
| that | line to test against | |
| [out] | point | (optional) intersection point if found |