gwnavruntime/dynamicnavmesh/polygonbuilder.h Source File

polygonbuilder.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 
15 
16 namespace Kaim
17 {
18 
19 class DisplayList;
20 class WorkingMemory;
21 class DynamicNavMeshQuery;
22 
23 class PolygonBuilder
24 {
25  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
26 public:
27  PolygonBuilder(DynamicNavMeshQuery* query): m_query(query) {}
28 
29  KyResult Init(WorkingMemory* workingMemory);
30  enum BuildStatus { BuildDone, BuildInPRocess };
31  KyResult Build(WorkingMemory* workingMemory, KyArray<MergedPolygonWithHoles>& result, BuildStatus& buildStatus);
32 
33 public:
34  void RenderInput(WorkingMemory* workingMemory, KyFloat32 rasterPrecision, const Vec2i& cellOffset, DisplayList& displayList);
35  void RenderOutput(WorkingMemory* workingMemory, const KyArray<MergedPolygonWithHoles>& output, KyFloat32 rasterPrecision, const Vec2i& cellOffset, DisplayList& displayList);
36 
37 private:
38  KyResult ExtractRawPolygons(WorkingMemory* workingMemory, BuildStatus& buildStatus);
39  KyResult ComputePolygonWinding(WorkingMemory* workingMemory);
40  KyResult BindHoles(WorkingMemory* workingMemory);
41  KyResult BuildOutput(WorkingMemory* workingMemory, KyArray<MergedPolygonWithHoles>& result);
42 
43 private:
44  DynamicNavMeshQuery* m_query;
45 };
46 
47 } // namespace Kaim
48 
#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
float KyFloat32
float
Definition: types.h:32