Pioneer
SpeedLines.h
Go to the documentation of this file.
1 // Copyright © 2008-2021 Pioneer Developers. See AUTHORS.txt for details
2 // Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3 
4 #ifndef _SPEEDLINES_H
5 #define _SPEEDLINES_H
6 
7 #include "matrix4x4.h"
8 #include "vector3.h"
10 #include "graphics/Material.h"
11 
12 namespace Graphics {
13  class Renderer;
14  class RenderState;
15 }
16 
17 class Ship;
18 
19 // virtual space dust to give a sense of movement
20 
21 class SpeedLines {
22 public:
23  SpeedLines(Ship *);
24 
25  void Update(float time);
26  void Render(Graphics::Renderer *);
27 
28  void SetTransform(const matrix4x4d &t) { m_transform = t; }
29 
30  Ship *GetShip() const { return m_ship; }
31 
32 private:
33  static void Init();
34  static float BOUNDS;
35  static int DEPTH;
36  static float SPACING;
37  static float MAX_VEL;
38 
39  void CreateVertexBuffer(Graphics::Renderer *r, const Uint32 size);
40 
41  Ship *m_ship;
42 
43  std::vector<vector3f> m_points;
44 
45  Graphics::RenderState *m_renderState;
47  std::unique_ptr<Graphics::VertexArray> m_varray;
48  std::unique_ptr<Graphics::VertexBuffer> m_vbuffer;
49 
50  matrix4x4d m_transform;
51 
52  bool m_visible;
53  float m_lineLength;
54  vector3f m_dir;
55 };
56 
57 #endif
Definition: RenderState.h:25
Definition: Renderer.h:39
Definition: Ship.h:64
Definition: SpeedLines.h:21
SpeedLines(Ship *)
Definition: SpeedLines.cpp:20
void Update(float time)
Definition: SpeedLines.cpp:52
void SetTransform(const matrix4x4d &t)
Definition: SpeedLines.h:28
void Render(Graphics::Renderer *)
Definition: SpeedLines.cpp:112
Ship * GetShip() const
Definition: SpeedLines.h:30
Definition: Background.h:13