gwnavruntime/math/integersegmentutils.h Source File
Go to the documentation of this file.
9 #ifndef Navigation_IntegerSegmentUtils_H
10 #define Navigation_IntegerSegmentUtils_H
22 CutSorter(
const Vec2i& edgeStart) : m_edgeStart(edgeStart) {}
23 bool operator() (
const Vec2i& cut1,
const Vec2i& cut2)
const
25 return (cut1 - m_edgeStart).GetSquareLength() > (cut2 - m_edgeStart).GetSquareLength();
32 namespace IntegerSegment
39 static bool Between(
const T& pt,
const T& edgeStart,
const T& edgeEnd);
43 static bool IsVertical(
const T& edgeStart,
const T& edgeEnd);
47 static bool IsHorizontal(
const T& edgeStart,
const T& edgeEnd);
51 static bool LessSlopeUnit(T dx1, T dy1, T dx2, T dy2);
54 static bool LessSlope(
const Vec2i& a,
const Vec2i& b,
const Vec2i& c);
57 static bool ArePointsAligned(
const Vec2i& a,
const Vec2i& b,
const Vec2i& c);
62 static KyInt32 OnAboveOrBelow(
const Vec2i& pt,
const Vec2i& edgeStart,
const Vec2i& edgeEnd);
66 bool SegmentVsSegment2d_hp(
const Vec2i& a,
const Vec2i& b,
const Vec2i& c,
const Vec2i& d, Vec2i& intersection);
68 bool SegmentVsSegment2d_rounded(
const Vec2i& a,
const Vec2i& b,
const Vec2i& c,
const Vec2i& d, Vec2i& intersection);
69 bool SegmentVsSegment2dWithBoxes_rounded(
const Vec2i& a,
const Vec2i& b,
const Vec2i& c,
const Vec2i& d,
const Box2i& boxAB,
const Box2i& boxCD, Vec2i& intersection);
72 bool SegmentVsSegment2d(
const T& a,
const T& b,
const T& c,
const T& d);
83 #endif // Navigation_IntegerSegmentUtils_H
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
Definition: gamekitcrowddispersion.h:20
__int64 KyInt64
Type used internally to represent a 64-bit integer.
Definition: types.h:37
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43