10 #ifndef Navigation_ChannelArrayComputer_H
11 #define Navigation_ChannelArrayComputer_H
33 ChannelArrayResult_StartNewPathSection,
34 ChannelArrayResult_ComputingChannel_DiagonalStrip_Init,
35 ChannelArrayResult_ComputingChannel_DiagonalStrip,
36 ChannelArrayResult_ComputingChannel_StringPull_Init,
37 ChannelArrayResult_ComputingChannel_StringPull,
38 ChannelArrayResult_ComputingChannel_GateArray_Init,
39 ChannelArrayResult_ComputingChannel_GateArray,
40 ChannelArrayResult_ComputingChannel_PreChannelPolyline,
41 ChannelArrayResult_ComputingChannel_PostChannelPolyline,
42 ChannelArrayResult_ComputingAggregatedPath,
43 ChannelArrayResult_ComputingChannelWidth,
45 ChannelArrayResult_Error_InvalidRawPath,
46 ChannelArrayResult_Error_ChannelComputation_DiagonalStrip,
47 ChannelArrayResult_Error_ChannelComputation_StringPull,
48 ChannelArrayResult_Error_ChannelComputation_GateArray,
49 ChannelArrayResult_Error_ChannelComputation_PreChannelPolyline,
50 ChannelArrayResult_Error_ChannelComputation_PostChannelPolyline,
51 ChannelArrayResult_Error_PathAggregation,
52 ChannelArrayResult_Error_ChannelWidthComputation,
54 ChannelArrayResult_Done
57 class ChannelArrayComputer
62 ChannelArrayComputer();
63 ~ChannelArrayComputer();
65 void SetChannelComputerConfig(
const ChannelComputerConfig& channelComputerConfig) { m_channelComputerConfig = channelComputerConfig; }
67 void* GetTraverseLogicUserData()
const {
return m_traverseLogicUserData; }
68 void SetTraverseLogicUserData(
void* traverseLogicUserData) { m_traverseLogicUserData = traverseLogicUserData; }
71 void Init(Path* rawPath, PathClamperFlagMask pathClamperFlagMask);
74 template<
class TraverseLogic>
75 void Advance(WorkingMemory* workingMemory);
76 bool IsFinished()
const {
return m_result >= ChannelArrayResult_Error_InvalidRawPath; }
79 template<
class TraverseLogic>
80 KyResult FullCompute(WorkingMemory* workingMemory, Path* rawPath, PathClamperFlagMask pathClamperFlagMask, Ptr<Path>& pathWithChannels);
83 template<
class TLogic>
84 KyResult ComputePreChannelPolyline(WorkingMemory* workingMemory, Channel* channel);
85 template<
class TLogic>
86 KyResult ComputePostChannelPolyline(WorkingMemory* workingMemory, Channel* channel);
87 template<
class TLogic>
88 KyResult ComputeChannelPolylineSection(Database* database, WorkingMemory* workingMemory,
89 const Vec3f& gatePathPos,
const Vec3f& gateStartPos,
const Vec3f& gateEndPos, KyArray<Vec2f>& polyline);
91 template<
class TLogic>
92 KyResult CreateAggregatedPath(WorkingMemory* workingMemory);
94 template<
class TLogic>
95 KyResult CreateChannelPath(Database* database, WorkingMemory* workingMemory,
const Channel& channel, Ptr<Path>& channelPath);
97 void UpdateChannelSectionFromPath(
const Path* channelPath,
KyUInt32 channelIdx, Ptr<Channel>& channel);
99 KyResult FillAggregatedPathWithChannelPath(
const Path* ChannelPath,
KyUInt32& currentAggregatedPathEdgeIndex,
103 void EnlargeCellBoxFromPolyline(
const KyArray<Vec2f>& polyline,
CellBox& cellBox);
105 KyResult SplitChannelOnCollapsedSections(
const Channel* originalChannel,
KyUInt32 originalChannelStartPathNodeIdx, ChannelArray* finalChannelArray);
107 bool GetNextEdgeOnNavMesh(
const KyUInt32 currentEdgeIdx,
KyUInt32& nextOnNavMeshEdgeIdx);
108 bool GetNextEdgeNotOnNavMesh(
const KyUInt32 currentEdgeIdx,
KyUInt32& nextOnNavMeshEdgeIdx);
110 void FindEndNodeIdxOfNavMeshSection();
111 void FindEndNodeIdxOfNonNavMeshSection();
113 void SetPathNodeToPathWithChannels(
const Path* path,
KyUInt32 pathNodeIndex,
KyUInt32 aggregatedPathNodeIndex);
114 void SetPathEdgeToPathWithChannels(
const Path* path,
KyUInt32 pathEdgeIndex,
KyUInt32 aggregatedPathEdgeIndex);
118 ChannelComputerConfig m_channelComputerConfig;
119 void* m_traverseLogicUserData;
120 PathClamperFlagMask m_pathClamperFlagMask;
122 KyArray<KyUInt32> m_navGraphSectionBoundaryIndices;
123 KyUInt32 m_currentSectionStartNodeIdx;
124 KyUInt32 m_currentSectionEndNodeIdx;
127 Ptr<ChannelArray> m_channelArray;
128 Ptr<Path> m_pathWithChannels;
132 Ptr<Channel> m_channelUnderConstruction;
134 DiagonalStrip m_diagonalStrip;
135 BubbleArray m_bubbleArray;
136 StringPulledBubbleList m_stringPulledBubbleList;
138 DiagonalStripComputer m_diagonalStripComputer;
139 StringPuller m_stringPuller;
140 GateArrayComputer m_gateArrayComputer;
142 bool m_advancedVisualDebuggingEnabled;
143 ChannelArrayComputerStats m_stats;
153 #endif // Navigation_ChannelArrayComputer_H
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Box2i CellBox
A type that represents a bounding box around cells in a 2D grid.
Definition: navmeshtypes.h:34
Indicates the query has not yet been launched.
Definition: channelarraycomputer.h:31
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
Definition: gamekitcrowddispersion.h:20
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Indicates that the query has not yet been launched.
Definition: iquery.h:347
ChannelArrayComputerResult
Definition: channelarraycomputer.h:28
Indicates the query has not yet been initialized.
Definition: channelarraycomputer.h:30