Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plane_display.h
Go to the documentation of this file.
1 // -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
2 
3 #ifndef VEGASTRIKE_GFX_RADAR_PLANE_DISPLAY_H
4 #define VEGASTRIKE_GFX_RADAR_PLANE_DISPLAY_H
5 
6 #include <vector>
7 #include <queue>
8 #include "gfx/vec.h"
9 #include "gfx/matrix.h"
10 #include "sensor.h"
11 #include "dual_display.h"
12 
13 class VSSprite;
14 struct GFXColor; // Edit from class to struct as defined in gfxlib_struct.
15 
16 namespace Radar
17 {
18 
19 struct ViewArea;
20 
22 {
23 public:
24  PlaneDisplay();
25 
26  void Draw(const Sensor& sensor, VSSprite *, VSSprite *);
27 
28  void OnDockEnd();
29  void OnJumpEnd();
30 
31 protected:
32  typedef std::vector<float> AngleSequence;
33 
34  void DrawGround(const Sensor&, const ViewArea&);
35  void DrawNear(const Sensor&, const Sensor::TrackCollection&);
36  void DrawDistant(const Sensor&, const Sensor::TrackCollection&);
37  void DrawTrack(const Sensor&, const ViewArea&, const Track&, float);
38  void DrawTarget(Track::Type::Value, const Vector&, const Vector&, float, const GFXColor&);
39  void DrawTargetMarker(const Vector&, const Vector&, const Vector&, float, const GFXColor&, bool);
40 
41  void Animate();
42  void PrepareAnimation(const Vector&, const Vector&, const AngleSequence&, const AngleSequence&, const AngleSequence&);
43 
44  void CalculateRotation();
45  Vector Projection(const ViewArea&, const Vector&);
46 
47 protected:
53  std::vector<Vector> groundPlane;
54  float radarTime;
55 
56  // Primitive animation system
58  {
59  float duration;
61  };
62  typedef std::queue<AnimationItem> AnimationCollection;
68 };
69 
70 } // namespace Radar
71 
72 #endif