]> git.mxchange.org Git - flightgear.git/blob - src/Environment/ridge_lift.hxx
Fix stray back-button in Qt launcher
[flightgear.git] / src / Environment / ridge_lift.hxx
1 // simulates ridge lift
2 //
3 // Written by Patrice Poly
4 // Copyright (C) 2009 Patrice Poly - p.polypa@gmail.com
5 //
6 //
7 // Entirely based  on the paper : 
8 // http://carrier.csi.cam.ac.uk/forsterlewis/soaring/sim/fsx/dev/sim_probe/sim_probe_paper.html
9 // by Ian Forster-Lewis, University of Cambridge, 26th December 2007
10 //
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License as
14 // published by the Free Software Foundation; either version 2 of the
15 // License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 // General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
25 //
26
27
28 #ifndef _FG_RidgeLift_HXX
29 #define _FG_RidgeLift_HXX
30
31 #ifdef HAVE_CONFIG
32 #  include <config.h>
33 #endif
34
35
36 #include <string>
37 using std::string;
38
39 #include <simgear/props/tiedpropertylist.hxx>
40
41 class FGRidgeLift : public SGSubsystem {
42 public:
43
44         FGRidgeLift();
45         ~FGRidgeLift();         
46         
47         virtual void bind();
48         virtual void unbind();
49         virtual void update(double dt);
50         virtual void init();
51
52         inline double getStrength() const { return strength; };
53
54         inline double get_probe_elev_m( int index ) const { return probe_elev_m[index]; };
55         inline double get_probe_lat_deg( int index ) const { return probe_lat_deg[index]; };
56         inline double get_probe_lon_deg( int index ) const { return probe_lon_deg[index]; };
57         inline double get_slope( int index ) const { return slope[index]; };
58
59 private:
60         static const double dist_probe_m[5];
61
62         double strength;
63         double timer;
64
65         double probe_lat_deg[5];
66         double probe_lon_deg[5];
67         double probe_elev_m[5];
68
69         double slope[4];
70
71         double lift_factor;
72
73         SGPropertyNode_ptr _enabled_node;
74         SGPropertyNode_ptr _ridge_lift_fps_node;
75
76         SGPropertyNode_ptr _surface_wind_from_deg_node;
77         SGPropertyNode_ptr _surface_wind_speed_node;
78
79         SGPropertyNode_ptr _user_altitude_agl_ft_node;
80         SGPropertyNode_ptr _user_longitude_node;
81         SGPropertyNode_ptr _user_latitude_node;
82         SGPropertyNode_ptr _ground_elev_node;
83
84         simgear::TiedPropertyList _tiedProperties;
85 };
86
87 #endif  // _FG_RidgeLift_HXX