26 T length()
const noexcept {
27 return glm::distance(p1, p2);
37 auto s = other.p2 - other.p1;
60 auto cross = [](glm::vec<2, T> v, glm::vec<2, T> w) {
61 return v.x * w.y - v.y * w.x;
72 auto rCrossS = cross(r, s);
73 auto t = cross(q - p, s) * glm::sign(rCrossS);
74 auto u = cross(q - p, r) * glm::sign(rCrossS);
75 rCrossS = glm::abs(rCrossS);
77 return t >= 0 && u >= 0 && t <= rCrossS && u <= rCrossS;
glm::vec< 2, T > APoint2D
2D point.
Definition: APoint2D.h:21
2D line segment.
Definition: ALineSegment.h:22