8 #ifndef Navigation_Intersections_H
9 #define Navigation_Intersections_H
23 enum Clockwiseness { Clockwiseness_CCW = 0, Clockwiseness_CW = 1 };
30 static bool IsPointInsideTriangle2d(
const Vec3f& p,
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3);
42 static bool IsOnTheLeftOfSegment2d(
const Vec3f& p,
const Vec3f& v1,
const Vec3f& v2);
43 static bool IsOnTheLeftOfSegment2d(
const Vec2f& p,
const Vec2f& v1,
const Vec2f& v2);
45 static bool IsStrictlyOnTheLeftOfSegment2d(
const Vec3f& p,
const Vec3f& v1,
const Vec3f& v2);
46 static bool IsStrictlyOnTheLeftOfSegment2d(
const Vec2f& p,
const Vec2f& v1,
const Vec2f& v2);
52 static bool AABBVsAABB2d(
const Box2LL& box1,
const Box2LL& box2);
53 static bool AABBVsAABB2d(
const Box2i& box1,
const Box2i& box2);
54 static bool AABBVsAABB2d(
const Box2f& box1,
const Box2f& box2);
55 static bool AABBVsAABB3d(
const Box3f& box1,
const Box3f& box2);
56 static bool AABBVsAABB2d(
const Box2f& box1,
const Box3f& box2);
60 static bool AABBVsOrientedBox2d(
const OrientedBox2d& orientedBox2d,
const Box2f& box);
61 static bool AABBVsOrientedBox2d(
const CoordPos64& o1,
const Vec2LL& lengthVec,
const Vec2LL& widthVec,
const CoordBox64& aABbox);
63 static bool SegmentVsDisk2d(
const Vec3f& a,
const Vec3f& b,
const Vec3f& c,
KyFloat32 radius);
64 static bool SegmentVsDisk2d(
const Vec3f& a,
const Vec3f& b,
const Vec3f& c,
KyFloat32 radius, Vec3f& intersection);
67 static bool SegmentVsCircle2d(
const Vec3f& a,
const Vec3f& b,
const Vec3f& c,
KyFloat32 radius, Vec3f& firstIntersection);
71 static bool SegmentVsOrientedCircleArc2d(
const Vec3f& segmentStart,
const Vec3f& segmentEnd,
72 const Vec3f& circleCenter,
KyFloat32 radius, Clockwiseness clockwiseness,
73 const Vec3f& circleArcStart,
const Vec3f& circleArcEnd, Vec3f& firstIntersection,
KyFloat32 fullTurnToleranceSin = 0.01f);
75 static bool SegmentVsConvexQuad2D(
const Vec3f& v1,
const Vec3f& v2,
76 const Vec3f& pointOnStartSideLeft,
const Vec3f& pointOnStartSideRight,
const Vec3f& pointOnEndSideRight,
const Vec3f& pointOnEndSideLeft);
78 static bool SegmentVsOrientedBox2d(
const Vec3f& v1,
const Vec3f& v2,
const OrientedBox2d& orientedBox2d);
79 static bool SegmentVsOrientedBox2d(
const CoordPos64& v1,
const CoordPos64& v2,
const CoordPos64& o1,
const Vec2LL& lengthVec,
const Vec2LL& widthVec);
82 static bool SegmentVsExtendedOrientedBox2d(
const Vec3f& v1,
const Vec3f& v2,
const OrientedBox2d& orientedBox2d,
const KyFloat32 extralength,
bool& outsideExtendedBox);
84 static bool SegmentVsAABB2d(
const Vec3f& v1,
const Vec3f& v2,
const Box2f& aabb2d);
85 static bool SegmentVsAABB2d(
const Vec2i& v1,
const Vec2i& v2,
const Box2i& aabb2d);
88 static bool SegmentVsCapsule2d(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& center,
const KyFloat32 radius,
const Vec2f& normalizedDir2D,
const KyFloat32 distCast);
90 static bool SegmentVsCapsule2d(
const Vec3f& v1,
const Vec3f& v2,
const OrientedBox2d& orientedBox2d,
const Vec3f& center1,
const Vec3f& center2,
const KyFloat32 radius);
93 static bool SegmentVsCrossSectionCapsule2d(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& center,
const KyFloat32 radius,
const Vec2f& normalizedDir2D,
const KyFloat32 distCast,
const KyFloat32 distOnRight,
const KyFloat32 distOnLeft);
95 static bool SegmentVsCrossSectionCapsule2d(
const Vec3f& v1,
const Vec3f& v2,
const OrientedBox2d& box,
const Vec3f& centerOfEndDisk,
const KyFloat32 radius,
const OrientedBox2d& boxOfEndDisk);
97 static bool SegmentVsTriangle2d(
const Vec3f& a,
const Vec3f& b,
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3);
98 static bool SegmentVsTriangle2d(
const Vec2f& a,
const Vec2f& b,
const Vec2f& v1,
const Vec2f& v2,
const Vec2f& v3);
101 static bool TriangleVsOrientedBox2d(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3,
const OrientedBox2d& orientedBox2d);
105 static bool TriangleVsTriangle2d(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3,
const Vec3f& u1,
const Vec3f& u2,
const Vec3f& u3);
108 static bool TriangleVsAABB2d(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3,
const Box2f& box);
109 static bool OverlappingOrientedBox2dVsTriangle3D(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3,
const OrientedBox2d& orientedBox2d,
const KyFloat32 toleranceBelow,
const KyFloat32 toleranceAbove);
111 static bool SegmentVsSegment2d(
const Vec2f& a,
const Vec2f& b,
const Vec2f& c,
const Vec2f& d);
112 static bool SegmentVsSegment2d(
const Vec2f& a,
const Vec2f& b,
const Vec2f& c,
const Vec2f& d, Vec2f& intersection);
114 static bool SegmentVsSegment2d(
const Vec3f& a,
const Vec3f& b,
const Vec3f& c,
const Vec3f& d);
115 static bool SegmentVsSegment2d(
const Vec3f& a,
const Vec3f& b,
const Vec3f& c,
const Vec3f& d, Vec3f& intersection);
134 static bool LineVsLine2d(
const Vec3f& a,
const Vec3f& b,
const Vec3f& c,
const Vec3f& d);
135 static bool LineVsLine2d(
const Vec3f& a,
const Vec3f& b,
const Vec3f& c,
const Vec3f& d, Vec3f& intersection);
136 static bool LineVsLine2d(
const Vec2f& a,
const Vec2f& b,
const Vec2f& c,
const Vec2f& d, Vec2f& intersection);
143 static KyFloat32 GetYValueOfLineVsVerticalAxis(
const Vec2f& pos1,
const Vec2f& pos2,
KyFloat32 wantedX);
144 static KyFloat32 GetXValueOfLineVsHorizontalAxis(
const Vec2f& pos1,
const Vec2f& pos2,
KyFloat32 wantedY);
147 static KyFloat32 ComputeAltitudeOfPointInPlane(
const Vec2f& p,
const Vec3f& planePoint,
const Vec3f& planeNormal);
148 static KyFloat32 ComputeAltitudeOfPointInTriangle(
const Vec3f& p,
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3);
149 static KyFloat32 ComputeAltitudeOfPointInTriangle(
const Vec2f& p,
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3);
152 static KyFloat32 ComputeInCircumCircleDeterminant(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3,
const Vec3f& p);
153 static bool IsPointInsideCircumCircle2d(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3,
const Vec3f& p);
154 static bool IsPointStrictlyInsideCircumCircle2d(
const Vec3f& v1,
const Vec3f& v2,
const Vec3f& v3,
const Vec3f& p);
171 #endif // Navigation_Intersections_H
Box2LL CoordBox64
A type that represents a bounding box in the integer 2D grid.
Definition: navmeshtypes.h:20
Vec2i CoordPos
A type that represents the position of a point within the 2D integer grid.
Definition: navmeshtypes.h:23
Vec2LL CoordPos64
A type that represents the position of a point within the 2D integer grid.
Definition: navmeshtypes.h:19
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