1 // fgwind.hxx -- routines to create variable winds
3 // Written by Torsten Dreyer
5 // Copyright (C) 2009 Torsten Dreyer - Torsten _at_ t3r*de
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.
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.
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.
25 #include <simgear/structure/SGReferenced.hxx>
27 ////////////////////////////////////////////////////////////////////////
28 // A Wind Modulator interface, generates gusts and wind direction changes
29 ////////////////////////////////////////////////////////////////////////
30 class FGWindModulator : public SGReferenced {
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; }
38 double direction_offset_norm;
39 double magnitude_factor_norm;
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 {
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; }
58 double direction_period;