24 class TriangulatorOutput;
27 class SweepLineOutput;
28 class TriangulatorOutput;
29 class DynamicNavFloor;
31 typedef Collection<Ptr<TagVolume>, MemStat_NavData> TagVolumeCollection;
33 enum MergerDebugDisplayListType
35 MERGER_DEBUG_DISPLAYLIST_INPUT_TAGVOLUMES,
36 MERGER_DEBUG_DISPLAYLIST_ROUND_SNAPPING,
37 MERGER_DEBUG_DISPLAYLIST_EDGE_CULLING,
38 MERGER_DEBUG_DISPLAYLIST_POLYGON_SCAN_INPUT,
39 MERGER_DEBUG_DISPLAYLIST_POLYGON_SCAN_OUTPUT,
40 MERGER_DEBUG_DISPLAYLIST_TRIANGULATION,
41 MERGER_DEBUG_DISPLAYLIST_COUNT
50 DYNNAVMESH_COLLECT_TAGVOLUME_FOR_NAVFLOOR,
51 DYNNAVMESH_EXTRACTING_ALL_NAVTAGS,
52 DYNNAVMESH_EXTRACTING_TAGVOLUMES_CONTOURS,
53 DYNNAVMESH_EXTRACTING_NAVFLOOR_CONTOUR,
54 DYNNAVMESH_ROUND_SNAPPING,
55 DYNNAVMESH_SWEEP_LINE_SORT_INPUT,
56 DYNNAVMESH_SWEEP_LINE_SCAN,
57 DYNNAVMESH_SWEEP_LINE_SORT_OUTPUT,
58 DYNNAVMESH_BUILD_POLYGONS_INIT,
59 DYNNAVMESH_BUILD_POLYGONS_PROCESS,
60 DYNNAVMESH_TRIANGULATE_POLYGONS_INIT,
61 DYNNAVMESH_TRIANGULATE_POLYGONS_PROCESS,
62 DYNNAVMESH_BUILD_DYNAMIC_NAVFLOOR,
63 DYNNAVMESH_BUILD_FIX_VERTEX_ALTITUDES,
64 DYNNAVMESH_BUILD_NAVFLOORBLOB,
86 static QueryType GetStaticType() {
return TypeDynamicNavMesh; }
96 void Initialize(
NavCell* navCell,
const TagVolumeCollection* integratedTagVolumesAtCellPos,
const TagVolumeCollection* newTagVolumes);
98 virtual void Advance(WorkingMemory* workingMemory);
102 const PixelPos& GetCellOriginPixel()
const {
return m_cellOriginPixel; }
108 void SetDebugDisplayLists(KyArray<DisplayList*> displayLists) { m_debugDisplayLists = displayLists; }
109 const DynamicNavMeshQueryStats& GetStats()
const {
return m_stats; }
124 KyResult TagAndCullEdges(WorkingMemory* workingMemory);
125 KyResult SortSweepLineOutput(WorkingMemory* workingMemory);
127 enum InitBuildPolygonResult { InitBuildPolygonResult_ReadyToBuild, InitBuildPolygonResult_NothingToDo } ;
128 KyResult InitBuildPolygon(WorkingMemory* workingMemory, InitBuildPolygonResult& initBuildPolygonResult);
129 enum BuildPolygonResult { BuildPolygonsResult_Finish, BuildPolygonsResult_InProcess} ;
130 KyResult BuildPolygon(WorkingMemory* workingMemory, BuildPolygonResult& buildPolygonsResult);
132 KyResult InitPolygonTriangulation(WorkingMemory* workingMemory);
134 KyResult PreparePolygonWithHolesTriangulation(WorkingMemory* workingMemory);
136 enum TriangulatePoygonResult { TriangulatePoygonResult_Finish, TriangulatePoygonResult_GoOn } ;
137 KyResult TriangulatePoygon(WorkingMemory* workingMemory, TriangulatePoygonResult& triangulatePoygonResult);
139 KyResult ComputeVerticesAltitudes(WorkingMemory* workingMemory);
140 KyResult FillDynamicNavFloorFromTriangulatorOutputs(WorkingMemory* workingMemory, KyArrayPOD<const SweepLineOutputEdgePiece*>& edgesForEdges);
141 KyResult FixHalfEdgeTypeInDynamicNavFloor(WorkingMemory* workingMemory,
const KyArrayPOD<const SweepLineOutputEdgePiece*>& edgesForEdges);
144 KyResult BuildNavFloorFromTriangulatorOutput(WorkingMemory* workingMemory);
146 KyResult BuildFinalBlobFromDynamicNavFloor(WorkingMemory* workingMemory);
149 enum CollectTagVolumeResult { CollectTagVolume_NothingToDo, CollectTagVolume_NeedToComputeDynamicNavFloor, CollectTagVolume_NeedToRestoreStaticNavFloor };
150 KyResult CollectTagVolumesImpactingNavCell(WorkingMemArray<TagVolume*>& allTagVolumes, CollectTagVolumeResult& collectTagVolumeResult);
151 KyResult CollectTagVolumesToIntegrateImpactingNavCell(WorkingMemArray<TagVolume*>& allTagVolumes,
const CellPos& cellPos,
KyUInt32& newTagVolumeCount);
152 KyResult CollectTagVolumesToRemoveImpactingNavCell(WorkingMemArray<TagVolume*>& allTagVolumes,
KyUInt32& tagVolumeToRemoveCount);
157 SetFinish(workingMemory);
160 void SetFinish(WorkingMemory* workingMemory);
163 DisplayList* GetDisplayList(
KyUInt32 index)
const;
168 PixelPos m_cellOriginPixel;
169 const TagVolumeCollection* m_integratedTagVolumesAtCellPos;
170 const TagVolumeCollection* m_newTagVolumes;
180 DynamicNavMeshQueryStats m_stats;
185 #if defined(KY_CONFIG_DEBUG_OR_DEV)
186 return m_debugDisplayLists.GetCount() > index ? m_debugDisplayLists[index] :
nullptr;
Indicates the query was successfully processed.
Definition: dynamicnavmeshquery.h:76
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:30
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
Indicates an error occurred while computing the altitude of the dynamic navmesh.
Definition: dynamicnavmeshquery.h:72
Indicates an unknown error occurred during the query processing.
Definition: dynamicnavmeshquery.h:74
DynamicNavMeshQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: dynamicnavmeshquery.h:176
Indicates an error occurred while culling edges.
Definition: dynamicnavmeshquery.h:69
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:162
Indicates an error occurred while building polygons from culled edges.
Definition: dynamicnavmeshquery.h:70
KyArray< Ptr< BlobHandler< NavFloorBlob > > > m_resultNavfloorHandlers
Output NavFloors with TagVolumes integrated remains to size 0 if nothing changed in this...
Definition: dynamicnavmeshquery.h:173
This class is a runtime wrapper of a NavCellBlob.
Definition: navcell.h:27
Indicates that the navfloor currently being processed is no longer valid.
Definition: dynamicnavmeshquery.h:66
Base class for all the queries that need to be time-sliced.
Definition: iquery.h:262
The DynamicNavMeshQuery is used to recompute a NavCell impacted by newly projected TagVolumes or remo...
Definition: dynamicnavmeshquery.h:81
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:57
Indicates an error occurred while triangulating the newly obtained polygons.
Definition: dynamicnavmeshquery.h:71
Indicates that insufficient working memory caused the query to stop.
Definition: dynamicnavmeshquery.h:67
DisplayList is used to push text, lines or shapes for rendering in the NavigationLab e...
Definition: displaylist.h:128
Navigation return code class.
Definition: types.h:108
2d vector using KyInt32
Definition: vec2i.h:18
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that.
Definition: dynamicnavmeshquery.h:73
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
Definition: dynamicnavmeshquery.cpp:110
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
Definition: dynamicnavmeshquery.cpp:55
Indicates the query has not yet been launched.
Definition: dynamicnavmeshquery.h:48
virtual void ReleaseWorkingMemoryOnCancelDuringProcess(WorkingMemory *workingMemory=nullptr)
Called when a query is canceled in FlushCommands while its status is QueryInProcess to make sure that...
Definition: dynamicnavmeshquery.cpp:90
DynamicNavMeshQueryResult
Enumerates the possible results of a DynamicNavMeshQuery.
Definition: dynamicnavmeshquery.h:45
Indicates that the query has not yet been launched.
Definition: iquery.h:296
virtual QueryType GetType() const
Get query type.
Definition: dynamicnavmeshquery.h:87
Indicates the query has not yet been initialized.
Definition: dynamicnavmeshquery.h:47
void Initialize()
Should be called by the derived class before trying to perform the query or to push it in a QueryQueu...
Definition: iquery.h:273
Indicates an error occurred while computing the intersections.
Definition: dynamicnavmeshquery.h:68