![]() |
Gorgon Game Engine
|
This class represents a set of points. More...
Public Member Functions | |
Line ()=default | |
Empty constructor. More... | |
Line (P_ start, P_ end) | |
P_::BaseType | MaxX () const |
Returns maximum X point. More... | |
P_::BaseType | MaxY () const |
Returns maximum Y point. More... | |
P_::BaseType | MinX () const |
Returns minimum X point. More... | |
P_::BaseType | MinY () const |
Returns minimum Y point. More... | |
Float | Offset () const |
Returns the offset of the line. Assumes the line is 2D. More... | |
Float | OffsetInv () const |
Returns the inverse offset of the line, where the line formula is now x = a * y + b. More... | |
Float | Slope () const |
Returns the slope of the line. Assumes the line is 2D. More... | |
Float | SlopeInv () const |
Returns the inverse slope of the line, where the line formula is now x = a * y + b. More... | |
int | XDirection () const |
Returns whether the line is moving left or right. More... | |
int | YDirection () const |
Returns whether the line is moving up or down. More... | |
Public Attributes | |
P_ | End |
Ending point of the line. More... | |
P_ | Start |
Starting point of the line. More... | |
This class represents a set of points.
This class can be used for contours, line lists, polygons, or even point clouds. Some of the functions may be meaningful for some of these uses.
Line | ( | P_ | start, |
P_ | end | ||
) |
P_::BaseType MaxX | ( | ) | const |
Returns maximum X point.
References Line< P_ >::End, and Line< P_ >::Start.
P_::BaseType MaxY | ( | ) | const |
Returns maximum Y point.
References Line< P_ >::End, and Line< P_ >::Start.
P_::BaseType MinX | ( | ) | const |
Returns minimum X point.
References Line< P_ >::End, and Line< P_ >::Start.
P_::BaseType MinY | ( | ) | const |
Returns minimum Y point.
References Line< P_ >::End, and Line< P_ >::Start.
Float Offset | ( | ) | const |
Returns the offset of the line. Assumes the line is 2D.
References Line< P_ >::Slope(), and Line< P_ >::Start.
Float OffsetInv | ( | ) | const |
Returns the inverse offset of the line, where the line formula is now x = a * y + b.
References Line< P_ >::SlopeInv(), and Line< P_ >::Start.
Float Slope | ( | ) | const |
Returns the slope of the line. Assumes the line is 2D.
References Line< P_ >::End, and Line< P_ >::Start.
Float SlopeInv | ( | ) | const |
Returns the inverse slope of the line, where the line formula is now x = a * y + b.
References Line< P_ >::End, and Line< P_ >::Start.
int XDirection | ( | ) | const |
Returns whether the line is moving left or right.
Left movement is -1 right movement is 1 and if line is vertical this function will return 0
References Line< P_ >::End, Gorgon::Sign(), and Line< P_ >::Start.
int YDirection | ( | ) | const |
Returns whether the line is moving up or down.
Up movement is -1 down movement is 1 and if line is horizontal this function will return 0
References Line< P_ >::End, Gorgon::Sign(), and Line< P_ >::Start.
P_ End |
Ending point of the line.
P_ Start |
Starting point of the line.