gwnavgeneration/navmesh/dynamicnavfloorbuilder.h Source File

dynamicnavfloorbuilder.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 
8 // Primary contact: LASI - secondary contact: NOBODY
9 #ifndef GwNavGen_DynamicNavFloorBuilder_H
10 #define GwNavGen_DynamicNavFloorBuilder_H
11 
16 
18 
21 
22 
23 namespace Kaim
24 {
25 
26 class IndexedTriangleSoup2i;
27 class DynamicNavFloor;
28 class BoundaryPolygon;
29 class BoundaryGraph;
30 class BoundarySimplifiedPolygon;
31 class BoundarySimplifiedContour;
32 class DynamicNavFloorHeightField;
33 class DynamicTriangulation;
34 class DynamicNavCell;
35 class BoundaryVertex;
36 class BoundarySimplifiedEdge;
37 class NavTag;
38 
39 class DynamicNavFloorBuilder
40 {
41  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
42 public:
43  DynamicNavFloorBuilder(GeneratorSystem* sys, const CellDesc& cellDesc)
44  : m_sys(sys), m_cellDesc(cellDesc), m_lastBuildDurationMs(0.0f), m_doProfile(false)
45  {
46  m_displayLists.SetVisualDebugServer(m_sys->m_visualDebugServer);
47  }
48 
49  KyResult BuildNavFloorFromBoundaryPolygons(const BoundarySimplifiedPolygon& polygon,
50  DynamicNavFloorHeightField* heightField, DynamicNavFloor& floor,
51  const KyArrayTLS_POD<KyUInt32>& connexIdxToNavTagIdx, const KyArrayTLS_POD<const NavTag*>& navtagArray);
52 
53  void ToggleProfiling(bool activate) {m_doProfile = activate;}
54  KyFloat32 GetLastBuildDurationMs() { return m_lastBuildDurationMs; }
55 
56 private:
57  KyResult AddNavConnexToDynamicNavFloor(const DynamicTriangulation& triangulation, DynamicNavFloor& floor, KyArrayTLS_POD<BoundarySimplifiedEdge*>& edgesForEdges, KyUInt32 navTagIdx);
58  KyResult MakeVerticallyAccurateTriangulation(DynamicTriangulation& triangulation, DynamicNavFloorHeightField* heightField);
59 
60  KyResult FixHalfEdgeTypeInDynamicNavFloor(DynamicNavFloor &dynaFloor, const KyArrayTLS_POD<BoundarySimplifiedEdge*>& edgesForEdges);
61 
62  void RenderDynamicTriangulationInVisualDebug(const DynamicTriangulation& triangulation);
63  void RenderHeightFieldInVisualDebug(const DynamicNavFloorHeightField& heightField);
64 public:
65  GeneratorSystem* m_sys;
66  CellDesc m_cellDesc;
67  KyFloat32 m_lastBuildDurationMs;
68  bool m_doProfile;
69  DisplayListManager m_displayLists;
70 };
71 
72 } // namespace Kaim
73 
74 
75 #endif //GwNavGen_DynamicNavFloorBuilder_H
76 
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
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43