#include <line_segment.h>
Inheritance diagram for CL_LineSegment2:

Public Member Functions | |
| CL_LineSegment2 () | |
| CL_LineSegment2 (const CL_LineSegment2x< int > ©) | |
| CL_LineSegment2 (const CL_Vec2< int > &point_p, const CL_Vec2< int > &point_q) | |
| CL_Vec2< int > | get_midpoint () const |
| Get the midpoint of this line. | |
| int | point_distance (const CL_Vec2< int > &point) |
| Return the distance from a point to a line. | |
| bool | collinear (const CL_LineSegment2x< int > second) const |
| Return true if two line segments are collinear. (All points are on the same line.). | |
| bool | intersects (const CL_LineSegment2x< int > second, bool collinear_intersect) const |
| Return true if two line segments intersect. | |
| CL_Vec2< int > | get_intersection (const CL_LineSegment2x< int > second, bool &intersect) const |
| Return the intersection point of two lines. | |
| int | point_right_of_line (CL_Vec2< int > point) const |
| Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B. | |
| CL_Vec2< int > | normal () const |
| Return the normal vector of the line from point A to point B. | |
| CL_LineSegment2x< int > & | clip (const CL_Rectx< int > &rect, bool &clipped) |
| Clip this line to a rectangle. | |
| bool | operator== (const CL_LineSegment2x< int > &line) const |
| == operator. | |
| bool | operator!= (const CL_LineSegment2x< int > &line) const |
| != operator. | |
Public Attributes | |
| CL_Vec2< int > | p |
| Start point on the line. | |
| CL_Vec2< int > | q |
A line segment has a start point and an end point
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Clip this line to a rectangle. If clipping was not successful, this object is undefined
|
|
|
Return true if two line segments are collinear. (All points are on the same line.).
|
|
||||||||||||
|
Return the intersection point of two lines.
|
|
|
Get the midpoint of this line.
|
|
||||||||||||
|
Return true if two line segments intersect.
|
|
|
Return the normal vector of the line from point A to point B. When using CL_Vec2i, the vector is an 8 bit fraction (multiplied by 256)
|
|
|
!= operator.
|
|
|
== operator.
|
|
|
Return the distance from a point to a line.
|
|
|
Return [<0, 0, >0] if the Point P is right, on or left of the line trough A,B.
|
|
|
Start point on the line.
|
|
|
|
1.4.6