]> git.mxchange.org Git - flightgear.git/blob - src/Environment/fgwind.hxx
Merge branch 'jmt/gps'
[flightgear.git] / src / Environment / fgwind.hxx
1 // fgwind.hxx -- routines to create variable winds
2 //
3 // Written by Torsten Dreyer
4 //
5 // Copyright (C) 2009 Torsten Dreyer - Torsten _at_ t3r*de
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 // $Id$
22 #ifndef _FGWIND_HXX
23 #define _FGWIND_HXX
24
25 #include <simgear/structure/SGReferenced.hxx>
26 \f
27 ////////////////////////////////////////////////////////////////////////
28 // A Wind Modulator interface, generates gusts and wind direction changes
29 ////////////////////////////////////////////////////////////////////////
30 class FGWindModulator : public SGReferenced {
31 public:
32         FGWindModulator();
33         virtual ~FGWindModulator();
34         virtual void update( double dt ) = 0;
35         double get_direction_offset_norm() const { return direction_offset_norm; }
36         double get_magnitude_factor_norm() const { return magnitude_factor_norm; }
37 protected:
38         double direction_offset_norm;
39         double magnitude_factor_norm;
40 };
41
42 \f
43 ////////////////////////////////////////////////////////////////////////
44 // A Basic Wind Modulator, implementation of FGWindModulator
45 // direction and magnitude variations are based on simple sin functions
46 ////////////////////////////////////////////////////////////////////////
47 class FGBasicWindModulator : public FGWindModulator {
48 public:
49         FGBasicWindModulator();
50         virtual ~FGBasicWindModulator();
51         virtual void update( double dt );
52         void set_direction_period( double _direction_period ) { direction_period = _direction_period; }
53         double get_direction_period() const { return direction_period; }
54         void set_speed_period( double _speed_period ) { speed_period = _speed_period; }
55         double get_speed_period() const{ return speed_period; }
56 private:
57         double elapsed;
58         double direction_period;
59         double speed_period;
60 };
61
62 #endif