Pioneer
HudTrail.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 _HUDTRAIL_H
5 #define _HUDTRAIL_H
6 
7 #include "Color.h"
8 #include "FrameId.h"
9 #include "matrix4x4.h"
10 #include "graphics/Drawables.h"
11 
12 #include <deque>
13 // trail drawn after an object to track motion
14 
15 namespace Graphics {
16  class Renderer;
17  class RenderState;
18 } // namespace Graphics
19 
20 class Body;
21 class Frame;
22 
23 class HudTrail {
24 public:
25  HudTrail(Body *b, const Color &);
26  void Update(float time);
27  void Render(Graphics::Renderer *r);
28  void Reset(const FrameId newFrame);
29 
30  void SetColor(const Color &c) { m_color = c; }
31  void SetTransform(const matrix4x4d &t) { m_transform = t; }
32 
33 private:
34  Body *m_body;
35  FrameId m_currentFrame;
36  float m_updateTime;
37  Color m_color;
38  matrix4x4d m_transform;
39  std::deque<vector3d> m_trailPoints;
40  Graphics::RenderState *m_renderState;
42 };
43 
44 #endif
Definition: Body.h:54
Definition: Frame.h:28
Definition: Drawables.h:79
Definition: RenderState.h:25
Definition: Renderer.h:39
Definition: HudTrail.h:23
void Update(float time)
Definition: HudTrail.cpp:28
void SetColor(const Color &c)
Definition: HudTrail.h:30
HudTrail(Body *b, const Color &)
Definition: HudTrail.cpp:15
void Render(Graphics::Renderer *r)
Definition: HudTrail.cpp:50
void SetTransform(const matrix4x4d &t)
Definition: HudTrail.h:31
void Reset(const FrameId newFrame)
Definition: HudTrail.cpp:86
Definition: Background.h:13
Definition: Color.h:66
Definition: FrameId.h:9