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
dual_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_DUALDISPLAY_H
4 #define VEGASTRIKE_GFX_RADAR_DUALDISPLAY_H
5 
6 #include <boost/random.hpp>
7 
8 #include "radar.h"
9 #include "viewarea.h"
10 
11 namespace Radar
12 {
13 
14 class DualDisplayBase : public Display
15 {
16  typedef boost::rand48 RandomEngine;
17  typedef boost::normal_distribution<float> RandomDistribution;
18  typedef boost::variate_generator<RandomEngine&, RandomDistribution> RandomGenerator;
19 
20 public:
22 
23  void OnPauseBegin();
24  void OnPauseEnd();
25 
26 protected:
27  float Jitter(float errorOffset, float errorRange);
28  void Jitter(float errorOffset, float errorRange, Vector& position);
29 
30 protected:
33  bool isPaused;
34 
35  RandomEngine randomEngine;
36  RandomDistribution randomDistribution;
37  RandomGenerator randomGenerator;
38 
39 private:
40  float lastRandomNumber;
41  Vector lastRandomVector;
42 };
43 
44 } // namespace Radar
45 
46 #endif