gwnavgeneration/navmesh/dynamicnavfloorbuilder.h Source File

dynamicnavfloorbuilder.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 
17 namespace Kaim
18 {
19 
20 class IndexedTriangleSoup2i;
21 class DynamicNavFloor;
22 class BoundaryPolygon;
23 class BoundaryGraph;
24 class BoundarySimplifiedPolygon;
25 class BoundarySimplifiedContour;
26 class NavFloorHeightField;
27 class DynamicTriangulation;
28 class DynamicNavCell;
29 class BoundaryVertex;
30 class BoundarySimplifiedEdge;
31 class NavTag;
32 
33 class DynamicNavFloorBuilder
34 {
35  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
36 public:
37  DynamicNavFloorBuilder(GeneratorSystem* sys, const CellDesc& cellDesc)
38  : m_sys(sys), m_cellDesc(cellDesc), m_lastBuildDurationMs(0.0f), m_doProfile(false)
39  {}
40 
41  KyResult BuildNavFloorFromBoundaryPolygons(const BoundarySimplifiedPolygon& polygon,
42  NavFloorHeightField* heightField, DynamicNavFloor& floor,
43  const KyArrayTLS_POD<KyUInt32>& connexIdxToNavTagIdx, const KyArrayTLS_POD<const NavTag*>& navtagArray);
44 
45  void ToggleProfiling(bool activate) {m_doProfile = activate;}
46  KyFloat32 GetLastBuildDurationMs() { return m_lastBuildDurationMs; }
47 
48 private:
49  KyResult AddNavConnexToDynamicNavFloor(const DynamicTriangulation& triangulation, DynamicNavFloor& floor, KyArrayTLS_POD<BoundarySimplifiedEdge*>& edgesForEdges, KyUInt32 navTagIdx);
50  KyResult MakeVerticallyAccurateTriangulation(DynamicTriangulation& triangulation, NavFloorHeightField* heightField);
51 
52  KyResult FixHalfEdgeTypeInDynamicNavFloor(DynamicNavFloor &dynaFloor, const KyArrayTLS_POD<BoundarySimplifiedEdge*>& edgesForEdges);
53 
54  void RenderDynamicTriangulationInVisualDebug(const DynamicTriangulation& dynTriangulation);
55  void RenderHeightFieldInVisualDebug(const NavFloorHeightField& heightField);
56 
57  KyFloat32 GetPointRadius();
58 
59 public:
60  GeneratorSystem* m_sys;
61  CellDesc m_cellDesc;
62  KyFloat32 m_lastBuildDurationMs;
63  bool m_doProfile;
64 };
65 
66 }
67 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#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