|
stc
|
Functions | |
| template<typename IT , VectorType2D< IT > VT> | |
| bool | isCounterClockwise (const VT &a, const VT &b, const VT &c) |
| template<SignedNumber IT, VectorType2D< IT > VT> | |
| IT | isPointOnLeftOfEdge (const VT &point, const VT &lineStart, const VT &lineEnd) |
| template<typename IT , VectorType2D< IT > VT> requires std::equality_comparable_with<VT, VT> | |
| bool | lineIntersectsLineInclusive (const VT &l1Start, const VT &l1End, const VT &l2Start, const VT &l2End) |
| template<typename IT , VectorType2D< IT > VT> | |
| bool | lineIntersectsRectangleInclusive (const VT &lineStart, const VT &lineEnd, const VT &rectCornerA, const VT &rectCornerB, const VT &rectCornerC, const VT &rectCornerD) |
| template<SignedNumber IT, VectorType2D< IT > VT> | |
| bool | rectangleContainsPointExclusive (const VT &point, const VT &rectCornerA, const VT &rectCornerB, const VT &rectCornerC, const VT &rectCornerD) |
| template<SignedNumber IT, VectorType2D< IT > VT> | |
| bool | rectangleContainsPointInclusive (const VT &point, const VT &rectCornerA, const VT &rectCornerB, const VT &rectCornerC, const VT &rectCornerD) |
| template<typename IT , VectorType2D< IT > VT> | |
| bool | rectangleContainsPointInclusive (const VT &point, const VT &startPosition, const VT &endPosition) |
| template<SignedNumber IT, VectorType2D< IT > VT> | |
| bool | lineIntersectsRectangleInclusive (const VT &lineStart, const VT &lineEnd, const VT &rectStart, const VT &rectEnd) |
| template<SignedNumber IT, VectorType2D< IT > VT> | |
| bool | lineIntersectsRectangleExclusive (const VT &lineStart, const VT &lineEnd, const VT &rectStart, const VT &rectEnd) |
Contains 2D geometric utility functions.
For 3D, when it eventually is implemented, see the g3d namespace.
|
inline |
Primarily an internal helper function. Checks if three provided points are counter-clockwise.
|
inline |
Returns whether or not a point is on the left of an edge
|
inline |
Equivalent to stc::math::g2d::lineIntersects, but also counts points on the line.
|
inline |
Checks if an axis-aligned rectangle is intersected by a line. The input assumes a rectangle defined by two opposing corners.
This function is inclusive, and includes points on the border.
|
inline |
Checks if a line intersects a rectangle.
Note that the input arguments are in the form
This function is inclusive, meaning tangential lines (including lines on the borders) are considered an intersection. For tangential lines not to be included, use stc::math::g2d::lineIntersectsRectangleExclusive.
Nether of the functions check if the line is contained within the rectangle. Use stc::math::g2d::rectangleContainsPointExclusive and stc::math::g2d::rectangleContainsPointInclusive to check point inclusion.
|
inline |
Checks if an axis-aligned rectangle is intersected by a line. The input assumes a rectangle defined by two opposing corners.
This function is inclusive, and includes points on the border.
|
inline |
Checks whether or not a rectangle contains a given point.
Note that the input arguments are in the form
Also note that there's no requirement each corner is in that exact position.
This is an exclusive function, so points on the border are not included.
|
inline |
Checks whether or not a rectangle contains a given point.
Note that the input arguments are in the form
Also note that there's no requirement each corner is in that exact position.
This is an inclusive function, so points on the border are included.
|
inline |
Checks if an axis-aligned rectangle contains a provided point. The input assumes a rectangle defined by two opposing corners.
This function is inclusive, and includes points on the border.