Pioneer
HudTrail.h
Go to the documentation of this file.
1 // Copyright © 2008-2023 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 "graphics/Drawables.h"
10 #include "matrix4x4.h"
11 
12 #include <deque>
13 // trail drawn after an object to track motion
14 
15 namespace Graphics {
16  class Renderer;
17 } // namespace Graphics
18 
19 class Body;
20 class Frame;
21 
22 class HudTrail {
23 public:
24  HudTrail(Body *b, const Color &);
25  void Update(float time);
26  void Render(Graphics::Renderer *r);
27  void Reset(const FrameId newFrame);
28 
29  void SetColor(const Color &c) { m_color = c; }
30  void SetTransform(const matrix4x4d &t) { m_transform = t; }
31 
32 private:
33  Body *m_body;
34  FrameId m_currentFrame;
35  float m_updateTime;
36  Color m_color;
37  matrix4x4d m_transform;
38  std::deque<vector3d> m_trailPoints;
39  std::unique_ptr<Graphics::Material> m_lineMat;
41 };
42 
43 #endif
Definition: Body.h:57
Definition: Frame.h:28
Definition: Drawables.h:80
Definition: Renderer.h:44
Definition: HudTrail.h:22
void Update(float time)
Definition: HudTrail.cpp:33
void SetColor(const Color &c)
Definition: HudTrail.h:29
HudTrail(Body *b, const Color &)
Definition: HudTrail.cpp:17
void Render(Graphics::Renderer *r)
Definition: HudTrail.cpp:55
void SetTransform(const matrix4x4d &t)
Definition: HudTrail.h:30
void Reset(const FrameId newFrame)
Definition: HudTrail.cpp:92
Definition: Background.h:14
Definition: Color.h:66
Definition: FrameId.h:9