9 #ifndef Navigation_TagVolumeQuery_H
10 #define Navigation_TagVolumeQuery_H
26 class TriangulatorOutput;
27 class ScopedDisplayList;
29 class SweepLineOutput;
30 class TriangulatorOutput;
31 class DynamicNavFloor;
33 typedef Collection<Ptr<TagVolume>, MemStat_NavData> TagVolumeCollection;
35 enum MergerDebugDisplayListType
37 MERGER_DEBUG_DISPLAYLIST_INPUT_TAGVOLUMES,
38 MERGER_DEBUG_DISPLAYLIST_ROUND_SNAPPING,
39 MERGER_DEBUG_DISPLAYLIST_EDGE_CULLING,
40 MERGER_DEBUG_DISPLAYLIST_POLYGON_SCAN_INPUT,
41 MERGER_DEBUG_DISPLAYLIST_POLYGON_SCAN_OUTPUT,
42 MERGER_DEBUG_DISPLAYLIST_TRIANGULATION,
43 MERGER_DEBUG_DISPLAYLIST_COUNT
52 DYNNAVMESH_COLLECT_TAGVOLUME_FOR_NAVFLOOR,
53 DYNNAVMESH_EXTRACTING_ALL_NAVTAGS,
54 DYNNAVMESH_EXTRACTING_TAGVOLUMES_CONTOURS,
55 DYNNAVMESH_EXTRACTING_NAVFLOOR_CONTOUR,
56 DYNNAVMESH_ROUND_SNAPPING,
57 DYNNAVMESH_SWEEP_LINE_SORT_INPUT,
58 DYNNAVMESH_SWEEP_LINE_SCAN,
59 DYNNAVMESH_SWEEP_LINE_SORT_OUTPUT,
60 DYNNAVMESH_BUILD_POLYGONS_INIT,
61 DYNNAVMESH_BUILD_POLYGONS_PROCESS,
62 DYNNAVMESH_TRIANGULATE_POLYGONS_INIT,
63 DYNNAVMESH_TRIANGULATE_POLYGONS_PROCESS,
64 DYNNAVMESH_BUILD_DYNAMIC_NAVFLOOR,
65 DYNNAVMESH_BUILD_FIX_VERTEX_ALTITUDES,
66 DYNNAVMESH_BUILD_NAVFLOORBLOB,
87 static QueryType GetStaticType() {
return TypeDynamicNavMesh; }
88 virtual QueryType GetType()
const {
return TypeDynamicNavMesh; }
97 void Initialize(
NavCell* navCell,
const TagVolumeCollection* integratedTagVolumesAtCellPos,
const TagVolumeCollection* newTagVolumes);
99 virtual void Advance(WorkingMemory* workingMemory);
105 const PixelPos& GetCellOriginPixel()
const {
return m_cellOriginPixel; }
109 const DynamicNavMeshQueryStats& GetStats()
const {
return m_stats; }
126 KyResult TagAndCullEdges(WorkingMemory* workingMemory);
127 KyResult SortSweepLineOutput(WorkingMemory* workingMemory);
129 enum InitBuildPolygonResult { InitBuildPolygonResult_ReadyToBuild, InitBuildPolygonResult_NothingToDo } ;
130 KyResult InitBuildPolygon(WorkingMemory* workingMemory, InitBuildPolygonResult& initBuildPolygonResult);
131 enum BuildPolygonResult { BuildPolygonsResult_Finish, BuildPolygonsResult_InProcess} ;
132 KyResult BuildPolygon(WorkingMemory* workingMemory, BuildPolygonResult& buildPolygonsResult);
134 KyResult InitPolygonTriangulation(WorkingMemory* workingMemory);
136 KyResult PreparePolygonWithHolesTriangulation(WorkingMemory* workingMemory);
138 enum TriangulatePoygonResult { TriangulatePoygonResult_Finish, TriangulatePoygonResult_GoOn } ;
139 KyResult TriangulatePoygon(WorkingMemory* workingMemory, TriangulatePoygonResult& triangulatePoygonResult);
141 KyResult ComputeVerticesAltitudes(WorkingMemory* workingMemory);
142 KyResult FillDynamicNavFloorFromTriangulatorOutputs(WorkingMemory* workingMemory, KyArrayPOD<const SweepLineOutputEdgePiece*>& edgesForEdges);
143 KyResult FixHalfEdgeTypeInDynamicNavFloor(WorkingMemory* workingMemory,
const KyArrayPOD<const SweepLineOutputEdgePiece*>& edgesForEdges);
146 KyResult BuildNavFloorFromTriangulatorOutput(WorkingMemory* workingMemory);
148 KyResult BuildFinalBlobFromDynamicNavFloor(WorkingMemory* workingMemory);
151 enum CollectTagVolumeResult { CollectTagVolume_NothingToDo, CollectTagVolume_NeedToComputeDynamicNavFloor, CollectTagVolume_NeedToRestoreStaticNavFloor };
152 KyResult CollectTagVolumesImpactingNavCell(WorkingMemArray<TagVolume*>& allTagVolumes, CollectTagVolumeResult& collectTagVolumeResult);
153 KyResult CollectTagVolumesToIntegrateImpactingNavCell(WorkingMemArray<TagVolume*>& allTagVolumes,
const CellPos& cellPos,
KyUInt32& newTagVolumeCount);
154 KyResult CollectTagVolumesToRemoveImpactingNavCell(WorkingMemArray<TagVolume*>& allTagVolumes,
KyUInt32& tagVolumeToRemoveCount);
159 SetFinish(workingMemory);
161 void SetFinish(WorkingMemory* workingMemory);
163 ScopedDisplayList* GetDisplayList(
KyUInt32 index)
const;
167 PixelPos m_cellOriginPixel;
168 const TagVolumeCollection* m_integratedTagVolumesAtCellPos;
169 const TagVolumeCollection* m_newTagVolumes;
179 DynamicNavMeshQueryStats m_stats;
184 #ifndef KY_BUILD_SHIPPING
185 return m_debugDisplayLists.GetCount() > index ? m_debugDisplayLists[index] :
KY_NULL;
197 #endif //Navigation_RayCanGoQuery_H
Indicates the query was successfully processed.
Definition: dynamicnavmeshquery.h:78
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Vec2i CellPos
A type that represents the position of a cell within a 2D grid.
Definition: navmeshtypes.h:33
Indicates an error occurred while computing the altitude of the dynamic navmesh.
Definition: dynamicnavmeshquery.h:74
Indicates an unknown error occurred during the query processing.
Definition: dynamicnavmeshquery.h:76
DynamicNavMeshQueryResult m_result
Updated during processing to indicate the result of the query.
Definition: dynamicnavmeshquery.h:184
DynamicNavMeshQueryResult GetResult() const
Read accessor for m_result.
Definition: dynamicnavmeshquery.h:103
Indicates an error occurred while culling edges.
Definition: dynamicnavmeshquery.h:71
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
Indicates an error occurred while building polygons from culled edges.
Definition: dynamicnavmeshquery.h:72
#define KY_NULL
Null value.
Definition: types.h:247
NavCell * m_navCell
Input Data.
Definition: dynamicnavmeshquery.h:174
KyArray< Ptr< BlobHandler< NavFloorBlob > > > m_resultNavfloorHandlers
Output NavFloors with TagVolumes integrated remains to size 0 if nothing changed in this...
Definition: dynamicnavmeshquery.h:181
This class is a runtime wrapper of a NavCellBlob.
Definition: navcell.h:33
virtual void ReleaseWorkingMemoryOnCancelDuringProcess(WorkingMemory *workingMemory=0)
Called when a query is canceled in FlushCommands while its status is QueryInProcess to make sure that...
Indicates that the navfloor currently being processed is no longer valid.
Definition: dynamicnavmeshquery.h:68
Base class for all the queries that need to be time-sliced.
Definition: iquery.h:306
The DynamicNavMeshQuery is used to recompute a NavCell impacted by newly projected TagVolumes or remo...
Definition: dynamicnavmeshquery.h:83
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
Indicates an error occurred while triangulating the newly obtained polygons.
Definition: dynamicnavmeshquery.h:73
Indicates that insufficient working memory caused the query to stop.
Definition: dynamicnavmeshquery.h:69
This class defines a two-dimensional vector whose coordinates are stored using 32-bit integers...
Definition: vec2i.h:26
Definition: gamekitcrowddispersion.h:20
Indicates that.
Definition: dynamicnavmeshquery.h:75
Indicates that the query has not yet been initialized.
Definition: iquery.h:346
void BindToDatabase(Database *database)
Binds the query with the specified Database, clears all the inputs and outputs and sets all other par...
ScopedDisplayList is used to push text, lines or shapes for rendering in the NavigationLab e...
Definition: displaylist.h:136
Indicates the query has not yet been launched.
Definition: dynamicnavmeshquery.h:50
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
DynamicNavMeshQueryResult
Enumerates the possible results of a DynamicNavMeshQuery.
Definition: dynamicnavmeshquery.h:47
Indicates that the query has not yet been launched.
Definition: iquery.h:347
Indicates the query has not yet been initialized.
Definition: dynamicnavmeshquery.h:49
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:404
Indicates an error occurred while computing the intersections.
Definition: dynamicnavmeshquery.h:70