15 class DatabaseGenMetrics;
17 class PolylineCastIntersector
22 enum VolumeType { Quad, TriangleAroundRight, TriangleAroundLeft };
27 BorderEdge() : m_startAxis_f(0.f), m_endAxis_f(0.f), m_startOrdinate_f(0.f), m_endOrdinate_f(0.f) {}
37 NavHalfEdgeRawPtr m_edgeRawPtr;
40 PolylineCastIntersector();
41 ~PolylineCastIntersector();
43 void InitTrapezoid(
const Vec3f& pathEdgeStartPos3f,
const Vec3f& pathEdgeEndPos3f,
const Vec3f& onStartLeft,
const Vec3f& onEndLeft,
const Vec3f& onStartRight,
44 const Vec3f& onEndRight,
const DatabaseGenMetrics& genMetrics);
46 void InitTriangleAroundRight(
const Vec3f& pathEdgeStartPos3f,
const Vec3f& pathEdgeEndPos3f,
const Vec3f& onStartLeft,
const Vec3f& onEndLeft,
const Vec3f& onRight,
47 const DatabaseGenMetrics& genMetrics);
49 void InitTriangleAroundLeft(
const Vec3f& pathEdgeStartPos3f,
const Vec3f& pathEdgeEndPos3f,
const Vec3f& onLeft,
const Vec3f& onStartRight,
const Vec3f& onEndRight,
50 const DatabaseGenMetrics& genMetrics);
52 bool IsEdgeVisible(
const CoordPos64& ,
const CoordPos64& ,
const NavHalfEdgeRawPtr& edgeRawPtr,
bool edgeIsCrossable);
57 void Init(VolumeType volumeType,
KyFloat32 integerPrecision,
const Vec3f& pathEdgeStartPos3f,
const Vec3f& pathEdgeEndPos3f,
const Vec3f& onStartLeft,
const Vec3f& onEndLeft,
58 const Vec3f& onStartRight,
const Vec3f& onEndRight);
60 bool ProcessCrossableEdge(
KyFloat32 firstAxis,
KyFloat32 lastAxis,
const Vec3f& firstPos,
const Vec3f& lastPos);
63 const NavHalfEdgeRawPtr& edgeRawPtr);
65 bool BoundEdgeToBorderEdgeAxis(
const Vec3f& firstPos,
const Vec3f& lastPos,
KyFloat32& firstAxis,
KyFloat32& lastAxis,
KyFloat32 borderEdgeAxisStart,
66 KyFloat32 borderEdgeAxisEnd, Vec3f& startPosForThisBorder, Vec3f& endPosForThisBorder);
68 bool SnapExtremityIfNeeded(
const Vec3f& firstPos,
const Vec3f& lastPos,
bool onLeft, BorderEdge* currentBorderEdge, Vec3f& startPosForThisBorder, Vec3f& endPosForThisBorder,
71 bool SnappedEdgeStartToBorderStartAxis(
const Vec3f& firstPos,
const Vec3f& lastPos, BorderEdge* currentBorderEdge,
bool onLeft, Vec3f& startPosForThisBorder,
72 KyFloat32& ordinateForStartPosForThisBorder);
74 bool SnappedEdgeEndToBorderEndAxis(
const Vec3f& firstPos,
const Vec3f& lastPos, BorderEdge* currentBorderEdge,
bool onLeft, Vec3f& endPosForThisBorder,
75 KyFloat32& ordinateForEndPosForThisBorder);
77 bool IsVisibleForBorderLeft(
const Vec3f& startPosForThisBorder,
const Vec3f& endPosForThisBorder, PolylineCastIntersector::BorderEdge* borderEdgeOnLeft);
78 bool IsVisibleForBorderRight(
const Vec3f& startPosForThisBorder,
const Vec3f& endPosForThisBorder, PolylineCastIntersector::BorderEdge* borderEdgeOnRight);
80 bool DoesEdgeIntersectVolume(
const Vec3f& startEdgePos,
const Vec3f& endEdgePos);
85 bool GetPointAtAxisOnEdgeRatio(
const Vec3f& startEdgePos,
const Vec3f& endEdgePos,
KyFloat32 wantedAxis,
KyFloat32& ratio);
86 bool GetPointAtAxisOnEdge(
const Vec3f& startEdgePos,
const Vec3f& endEdgePos,
KyFloat32 wantedAxis, Vec3f& pos);
88 bool BoundEdgeToTrapezoidEdge(Vec3f& startEdgePos, Vec3f& endEdgePos,
const Vec3f& trapezoidEdgeStart,
const Vec3f& trapezoidEdgeEnd);
89 bool BoundEdgeToTrapezoidLimit(Vec3f& startEdgePos, Vec3f& endEdgePos);
102 Vec3f m_edgeExtentForTest;
117 SharedPoolList<BorderEdge> m_borderEdgesOnLeft;
118 SharedPoolList<BorderEdge> m_borderEdgesOnRight;
119 SharedPoolList<BorderEdge>::NodePool m_borderEdgePool;
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Vec2LL CoordPos64
A type that represents the position of a point within the 2D integer grid.
Definition: navmeshtypes.h:16
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
KyFloat32 CrossProduct_z(const Vec2f &v1, const Vec2f &v2)
alias for CrossProduct, useful in some template functions
Definition: vec2f.h:123
float KyFloat32
float
Definition: types.h:32