All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DebugPrimitiveRendererEcef.h
1 // Copyright (c) 2014 eeGeo. All rights reserved.
2 
3 #pragma once
4 
5 #include "AllVertexTypes.h"
6 #include "DynamicBuffer.h"
7 #include "Rendering.h"
8 #include "Streaming.h"
9 #include "VectorMath.h"
10 #include "Camera.h"
11 #include "IRenderableFilter.h"
12 #include "DebugPrimitiveRenderable.h"
13 
14 #include <vector>
15 
16 namespace Eegeo
17 {
18  namespace DebugRendering
19  {
20  namespace Renderers
21  {
23  {
24  struct DebugPrimitiveSpec
25  {
26  DebugPrimitiveSpec()
27  {}
28 
29  std::vector<v3> LocalVerts;
30  std::vector<u16> LocalIndices;
31  };
32 
33  struct DebugPrimitiveEcef
34  {
35  m44 Orientation;
36  dv3 Origin;
37  v4 Color;
38  const DebugPrimitiveSpec* pPrimSpec;
39  float Lifetime;
40  };
41 
42  public:
44  const Rendering::VertexLayouts::VertexBinding& vertexBinding,
45  int vertexBufferSize,
46  int indexBufferSize);
47 
49 
50  void DrawCube(
51  const dv3& ecefOrigin,
52  const m44& transform,
53  const v4& colour,
54  const float lifetime);
55 
56  void DrawSphere(
57  const dv3& ecefOrigin,
58  const m44& transform,
59  const v4& colour,
60  const float lifetime);
61 
62  void DrawQuad(
63  const dv3& ecefOrigin,
64  const m44& transform,
65  const v4& colour,
66  const float lifetime);
67 
68  void Update(float dt, const Camera::RenderCamera& renderCamera);
69 
70  void GenerateGeometry(const Camera::RenderCamera& renderCamera);
71 
72  void EnqueueRenderables(const Rendering::RenderContext& renderContext, Rendering::RenderQueue& renderQueue);
73 
74  void SetDepthEnabled(const bool depthEnabled);
75 
76  private:
77  void DrawPrimitive(
78  const DebugPrimitiveSpec* pPrimSpec,
79  const dv3& ecefOrigin,
80  const m44& transform,
81  const v4& colour,
82  const float lifetime);
83 
84  void GenerateGeometryForSingleInstance(const DebugPrimitiveEcef& data,
85  const Camera::RenderCamera& renderCamera);
86 
87  DebugRendering::DebugPrimitiveRenderable* m_pDebugPrimitiveRenderable;
88 
89  DebugPrimitiveSpec m_primSpecCube;
90  DebugPrimitiveSpec m_primSpecSphere;
91  DebugPrimitiveSpec m_primSpecQuad;
92 
93  std::vector<DebugPrimitiveEcef> m_drawData;
94  };
95  }
96  }
97 }
98