All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DebugNavigationGraphMesh.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Rendering.h"
7 #include "Navigation.h"
8 #include "VectorMath.h"
9 #include "DebugRendering.h"
10 #include "DebugRenderable.h"
11 #include <vector>
12 
13 namespace Eegeo
14 {
15 
16  namespace Resources
17  {
18  namespace Roads
19  {
20  namespace Navigation
21  {
23  {
24  float VerticalOffset;
25  float GapLengthBetweenRoadVertices;
26  float CellConnectionMarkerLength;
27  float CellConnectionMarkerWidth;
28  float RoadLinkMarkerLength;
29  float RoadLinkMarkerWidth;
30  bool ColourCodeRoadDirections;
31  };
32 
34  {
35  public:
36 
37  // IH: Dependency on GLState in construction. These objects should only be constructed
38  // during the app's Draw() phase
40  const DebugNavigationGraphMeshConfig& config,
41  Eegeo::Rendering::GLState& glState);
42 
44 
45  void Draw(const Camera::RenderCamera& renderCamera, Rendering::GLState& glState);
46 
47  void SetPositionECEF(const Eegeo::dv3& posECEF);
48 
49  void Regenerate(const NavigationGraph& navGraph, Eegeo::Rendering::GLState& glState);
50 
51  static DebugNavigationGraphMeshConfig CreateDefaultConfig();
52  private:
53  void GenerateGeometry(const NavigationGraph& navGraph, Eegeo::Rendering::GLState& glState);
54  void AddQuad(std::vector<Eegeo::v3>& verts,
55  std::vector<Eegeo::v3>& colors,
56  std::vector<Eegeo::v2>& uvs,
57  std::vector<u16>& indices,
58  const Eegeo::v3& up,
59  const Eegeo::v3& v0,
60  const Eegeo::v3& v1,
61  const Eegeo::v3& startColor,
62  const Eegeo::v3& endColor,
63  const float halfWidth);
64 
65  void AddToConnections(std::vector<Eegeo::v3>& verts,
66  std::vector<Eegeo::v3>& colors,
67  std::vector<Eegeo::v2>& uvs,
68  std::vector<u16>& indices,
69  const NavigationGraph& navGraph,
70  const NavigationGraphRoad& road,
71  const Eegeo::v3& color,
72  const float halfWidth);
73 
74  void AddFromConnections(std::vector<Eegeo::v3>& verts,
75  std::vector<Eegeo::v3>& colors,
76  std::vector<Eegeo::v2>& uvs,
77  std::vector<u16>& indices,
78  const NavigationGraph& navGraph,
79  const NavigationGraphRoad& road,
80  const Eegeo::v3& color,
81  const float halfWidth);
82 
83  void AddLinkConnections(std::vector<Eegeo::v3>& verts,
84  std::vector<Eegeo::v3>& colors,
85  std::vector<Eegeo::v2>& uvs,
86  std::vector<u16>& indices,
87  const NavigationGraph& navGraph,
88  const NavigationGraphRoad& road);
89 
90 
91 
93 
94  std::vector<Eegeo::DebugRendering::SphereMesh*> m_singleVertexRoadSpheres;
95 
97  Eegeo::dv3 m_pos;
98  Eegeo::v3 m_roadColor;
100  };
101  }
102  }
103  }
104 }