]> git.mxchange.org Git - flightgear.git/blob - src/Environment/ridge_lift.hxx
Add aubmodels to AI objects
[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
40 class FGRidgeLift : public SGSubsystem {
41 public:
42
43         FGRidgeLift();
44         ~FGRidgeLift();         
45         
46         virtual void bind();
47         virtual void unbind();
48         virtual void update(double dt);
49         virtual void init();
50
51         inline double getStrength() const { return strength; };
52
53         inline double get_probe_elev_m( int index ) const { return probe_elev_m[index]; };
54         inline double get_probe_lat_deg( int index ) const { return probe_lat_deg[index]; };
55         inline double get_probe_lon_deg( int index ) const { return probe_lon_deg[index]; };
56         inline double get_slope( int index ) const { return slope[index]; };
57
58 private:
59         static const double dist_probe_m[5];
60
61         double strength;
62         double timer;
63
64         double probe_lat_deg[5];
65         double probe_lon_deg[5];
66         double probe_elev_m[5];
67
68         double slope[4];
69
70         double lift_factor;
71
72         SGPropertyNode_ptr _enabled_node;
73         SGPropertyNode_ptr _ridge_lift_fps_node;
74
75         SGPropertyNode_ptr _surface_wind_from_deg_node;
76         SGPropertyNode_ptr _surface_wind_speed_node;
77
78         SGPropertyNode_ptr _user_altitude_agl_ft_node;
79         SGPropertyNode_ptr _user_longitude_node;
80         SGPropertyNode_ptr _user_latitude_node;
81         SGPropertyNode_ptr _ground_elev_node;
82
83 };
84
85 #endif  // _FG_RidgeLift_HXX