19 class DynamicTriangulation;
20 class DynamicNavFloor;
21 class NavFloorStitcherData;
29 RUNTIMESTITCH_PROCESSING,
37 class MakeNavFloorStitchQuery :
public ITimeSlicedQuery
41 static QueryType GetStaticType() {
return TypeMakeNavFloorStitchQuery; }
42 virtual QueryType GetType()
const {
return TypeMakeNavFloorStitchQuery; }
44 MakeNavFloorStitchQuery();
45 virtual ~MakeNavFloorStitchQuery();
50 void BindToDatabase(Database* database);
53 virtual void Advance(WorkingMemory* workingMemory);
54 virtual void ReleaseWorkingMemoryOnCancelDuringProcess(WorkingMemory* workingMemory =
nullptr);
60 static void FillEdgeExtremities(
const NavFloorBlob* navFloorBlob,
NavHalfEdgeIdx halfEdgeIdx, Vec2i& start, Vec2i& end);
63 void ProcessNavFloor();
65 class NewCutAlongStaticEdge
68 NewCutAlongStaticEdge() {}
69 NewCutAlongStaticEdge(
const Vec2i& pos,
KyFloat32 alt) : m_pos(pos), m_altitude(alt) {}
70 bool operator==(
const NewCutAlongStaticEdge& other)
const {
return m_pos == other.m_pos; }
71 bool operator!=(
const NewCutAlongStaticEdge& other)
const {
return m_pos != other.m_pos; }
78 class RunTimeStitchCutSorter
81 RunTimeStitchCutSorter(
const Vec2i& stitch1To1EndVertex,
KyInt32 currentEdgeDir) :
82 m_stitch1To1EndVertex(stitch1To1EndVertex), m_coordIdx(currentEdgeDir) {}
84 bool operator() (
const NewCutAlongStaticEdge& cut1,
const NewCutAlongStaticEdge& cut2)
const
86 KY_ASSERT(cut1.m_pos[m_coordIdx] != m_stitch1To1EndVertex[m_coordIdx]);
87 KY_ASSERT(cut2.m_pos[m_coordIdx] != m_stitch1To1EndVertex[m_coordIdx]);
88 const KyInt32 diff1 = cut1.m_pos[m_coordIdx] - m_stitch1To1EndVertex[m_coordIdx];
89 const KyInt32 diff2 = cut2.m_pos[m_coordIdx] - m_stitch1To1EndVertex[m_coordIdx];
90 const KyInt32 squareDist1 = diff1*diff1;
91 const KyInt32 squareDist2 = diff2*diff2;
92 return squareDist1 < squareDist2;
95 Vec2i m_stitch1To1EndVertex;
100 void ComputeAndInsertAllCuts(NavFloorStitcherData& currentData,
KyUInt32 stitch1To1EdgeIdx,
const Vec2i& stitch1To1EndVertex,
101 NavFloorStitcherData& neighborData,
KyUInt32 neighborStitch1To1EdgeIdx, KyArray<NewCutAlongStaticEdge>& newCuts, DynamicTriangulation& dynTri);
102 void InsertexVertexInTriangulationOnEdge(DynamicTriangulation& dynTri,
KyUInt32 halfEdgeIdx, NewCutAlongStaticEdge& newCut);
103 void BuildDynamicTriangulationFromStaticNavFloorBlob(
const NavFloorBlob* floorBlob, DynamicTriangulation& dynTri);
104 void BuildDynamicNavFloorFromDynamicTriangulation(
const NavFloorBlob* floorBlob,
const NavFloor1To1StitchDataBlob& floor1To1StitchDataBlob,
105 const DynamicTriangulation& dynTri, DynamicNavFloor& dynaFloor);
107 void SetFinish(WorkingMemory* workingMemory);
108 void ReleaseWorkingMemory() {}
114 KyArray<Ptr<BlobHandler<NavFloorBlob> > > m_resultNavfloorHandlers;
118 KyArray<KyUInt16> m_navHalfEdgeToTriangulationEdge;
119 bool m_dynamicTriangulationFromFloorIsBuilt;
122 KY_INLINE
void MakeNavFloorStitchQuery::SetFinish(WorkingMemory* )
124 m_processStatus = QueryDone;
125 ReleaseWorkingMemory();
Indicates that insufficient working memory caused the query to stop.
Definition: makenavfloorstitchquery.h:31
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
KyUInt32 NavHalfEdgeIdx
An index that uniquely identifies a single edge of a triangle within the set of edges owned by a NavF...
Definition: navmeshtypes.h:84
Indicates the query was successfully processed.
Definition: makenavfloorstitchquery.h:34
Indicates the query has not yet been initialized.
Definition: makenavfloorstitchquery.h:26
MakeNavFloorStitchQueryResult
Enumerates the possible results of a MakeNavFloorStitchQuery.
Definition: makenavfloorstitchquery.h:24
QueryType
Enumerates all the type of query.
Definition: iquery.h:25
Indicates an unknown error occurred during the query processing.
Definition: makenavfloorstitchquery.h:32
KyUInt32 NavFloorIdx
An index that uniquely identifies a single NavFloor within the set of NavFloors owned by a NavCell...
Definition: navmeshtypes.h:112
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Indicates that the query has not yet been initialized.
Definition: iquery.h:295
std::int32_t KyInt32
int32_t
Definition: types.h:24
Indicates the query has not yet been launched.
Definition: makenavfloorstitchquery.h:27
Indicates that the query has not yet been launched.
Definition: iquery.h:296
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
float KyFloat32
float
Definition: types.h:32