]> git.mxchange.org Git - flightgear.git/blob - src/Environment/fgwind.hxx
Add variable winds (direction and gusts) for the boundary layer if defined in METAR.
[flightgear.git] / src / Environment / fgwind.hxx
1 #ifndef _FGWIND_HXX
2
3 #include <simgear/structure/SGReferenced.hxx>
4 \f
5 ////////////////////////////////////////////////////////////////////////
6 // A Wind Modulator interface, generates gusts and wind direction changes
7 ////////////////////////////////////////////////////////////////////////
8 class FGWindModulator : public SGReferenced {
9 public:
10         FGWindModulator();
11         virtual ~FGWindModulator();
12         virtual void update( double dt ) = 0;
13         double get_direction_offset_norm() const { return direction_offset_norm; }
14         double get_magnitude_factor_norm() const { return magnitude_factor_norm; }
15 protected:
16         double direction_offset_norm;
17         double magnitude_factor_norm;
18 };
19
20 \f
21 ////////////////////////////////////////////////////////////////////////
22 // A Basic Wind Modulator, implementation of FGWindModulator
23 // direction and magnitude variations are based on simple sin functions
24 ////////////////////////////////////////////////////////////////////////
25 class FGBasicWindModulator : public FGWindModulator {
26 public:
27         FGBasicWindModulator();
28         virtual ~FGBasicWindModulator();
29         virtual void update( double dt );
30         void set_direction_period( double _direction_period ) { direction_period = _direction_period; }
31         double get_direction_period() const { return direction_period; }
32         void set_speed_period( double _speed_period ) { speed_period = _speed_period; }
33         double get_speed_period() const{ return speed_period; }
34 private:
35         double elapsed;
36         double direction_period;
37         double speed_period;
38 };
39
40 #endif