gwnavruntime/dynamicnavmesh/rawedgeextractor.h Source File

rawedgeextractor.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
13 
14 namespace Kaim
15 {
16 
17 class WorkingMemory;
18 class DynamicNavMeshQuery;
19 template <class T>
20 class WorkingMemArray;
21 class WorkingMemBitField;
22 class NavFloorBlob;
23 class NavVertex;
24 
25 class RawEdgeExtractor
26 {
27  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
28 public:
29  RawEdgeExtractor(DynamicNavMeshQuery* query) :
30  m_query(query) {}
31 
32 public:
33  KyResult AssignTagVolumesToCurrentFloor(WorkingMemory* workingMemory);
34  KyResult ExtractSortedNavtags(WorkingMemory* workingMemory);
35  KyResult ExtractCurrentTagVolumeContour(WorkingMemory* workingMemory);
36  KyResult ExtractNavFloorContoursAndSortAllInputEdge(WorkingMemory* workingMemory);
37 
38 private:
39  KyResult FindHoleContour(WorkingMemory* workingMemory, NavHalfEdgeIdx firstHalfEdgeIdxOfContour,
40  WorkingMemArray<NavHalfEdgeIdx>& edgeIndiceOfContour, WorkingMemBitField& relevantClippingEdges, WorkingMemBitField& obstacleEdgesInHoles);
41 
42  KyResult FindConnexContour(WorkingMemory* workingMemory, NavHalfEdgeIdx firstHalfEdgeIdxOfContour,
43  WorkingMemArray<NavHalfEdgeIdx>& edgeIndiceOfContour, WorkingMemBitField& relevantClippingEdges);
44 
45  KyResult FindFullyInsideConnexContour(WorkingMemory* workingMemory, NavHalfEdgeIdx firstHalfEdgeIdxOfContour
46  , WorkingMemArray<NavHalfEdgeIdx>& edgeIndiceOfContour, WorkingMemBitField& relevantClippingEdges);
47 
48  PolygonWinding ComputeWinding(const WorkingMemArray<NavHalfEdgeIdx>& edgeIndiceOfContour, KyUInt32 lowerLeftStarEdgeIdxInContour,
49  const KyUInt32 contourEdgeCount, const NavVertex& lowerLeftPos, const NavFloorBlob* staticFloorBlob);
50 
51  void SetInputEdge(WorkingMemArray<InputEdge>& rawInputEdges, KyUInt32 inputEdgeIdx, KyUInt32 ownerIdx, KyUInt32 edgeOrigin,
52  KyUInt32 navTagIdx, const Vec2i& coordStart, const Vec2i& coordEnd, KyUInt32 stitch1To1EdgeIdx = KyUInt32MAXVAL);
53 
54 private:
55  // input
56  DynamicNavMeshQuery* m_query;
57 
58  KyUInt32 m_currentConnexContourIdx;
59  KyUInt32 m_currentHoleContourIdx;
60 };
61 
62 }
63 
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
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
#define KyUInt32MAXVAL
KyUInt32 max value
Definition: types.h:68