All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ScratchGeometry.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "TextMeshes.h"
7 #include "AllVertexTypes.h"
8 #include "VectorMath.h"
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace TextMeshes
14  {
15  namespace Internal
16  {
18  {
19  public:
20 
22 
23  void Reset(int reserveQuadCount);
24 
25  const std::vector<Rendering::VertexTypes::TextVertex>& Vertices() const { return m_vertices; };
26  const std::vector<u16> Indices() const { return m_indices; };
27 
28  inline void AddVertex(const Eegeo::v3& position, float u, float v, float shadowParam, float altitude);
29 
30  inline void AddVertices(std::vector<Rendering::VertexTypes::TextVertex>& vertices)
31  {
32  m_vertices.insert(m_vertices.end(), vertices.begin(), vertices.end());
33  }
34  private:
35  std::vector<Rendering::VertexTypes::TextVertex> m_vertices;
36  std::vector<u16> m_indices;
37 
38  int m_reserveQuadCount;
39 
40  void GrowIndexList(int quadCount);
41  };
42 
43  inline void ScratchGeometry::AddVertex(const Eegeo::v3& position, float u, float v, float shadowParam, float altitude)
44  {
45  m_vertices.push_back(
46  Rendering::VertexTypes::CreateTextVertex(
47  position.GetX(),
48  position.GetY(),
49  position.GetZ(),
50  altitude,
51  u,
52  v,
53  shadowParam
54  )
55  );
56 
57  }
58  }
59  }
60 }