gwnavruntime/dynamicnavmesh/polygonbuilder.h Source File

polygonbuilder.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 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 #ifndef Navigation_PolygonBuilder_H
8 #define Navigation_PolygonBuilder_H
9 
16 
17 namespace Kaim
18 {
19 
20 class ScopedDisplayList;
21 class WorkingMemory;
22 class DynamicNavMeshQuery;
23 
24 class PolygonBuilder
25 {
26  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
27 public:
28  PolygonBuilder(DynamicNavMeshQuery* query): m_query(query) {}
29 
30  KyResult Init(WorkingMemory* workingMemory);
31  enum BuildStatus { BuildDone, BuildInPRocess };
32  KyResult Build(WorkingMemory* workingMemory, KyArray<MergedPolygonWithHoles>& result, BuildStatus& buildStatus);
33 
34 public:
35  void RenderInput(WorkingMemory* workingMemory, KyFloat32 rasterPrecision, const Vec2i& cellOffset, ScopedDisplayList& displayList);
36  void RenderOutput(WorkingMemory* workingMemory, const KyArray<MergedPolygonWithHoles>& output, KyFloat32 rasterPrecision, const Vec2i& cellOffset, ScopedDisplayList& displayList);
37 
38 private:
39  KyResult ExtractRawPolygons(WorkingMemory* workingMemory, BuildStatus& buildStatus);
40  KyResult ComputePolygonWinding(WorkingMemory* workingMemory);
41  KyResult BindHoles(WorkingMemory* workingMemory);
42  KyResult BuildOutput(WorkingMemory* workingMemory, KyArray<MergedPolygonWithHoles>& result);
43 
44 private:
45  DynamicNavMeshQuery* m_query;
46 };
47 
48 } // namespace Kaim
49 
50 #endif // Navigation_PolygonBuilder_H
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43