1 // FGAIThermal - FGAIBase-derived class creates an AI thermal
3 // Original by Written by David Culp
5 // An attempt to refine the thermal shape and behaviour by WooT 2009
7 // Copyright (C) 2009 Patrice Poly ( WooT )
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef _FG_AIThermal_HXX
24 #define _FG_AIThermal_HXX
26 #include "AIManager.hxx"
33 class FGAIThermal : public FGAIBase {
39 void readFromScenario(SGPropertyNode* scFileNode);
41 virtual bool init(bool search_in_AI_path=false);
43 virtual void update(double dt);
45 inline void setMaxStrength( double s ) { max_strength = s; };
46 inline void setDiameter( double d ) { diameter = d; };
47 inline void setHeight( double h ) { height = h; };
48 inline void setMaxUpdraft( double lift ) { v_up_max = lift; };
49 inline void setMinUpdraft( double sink ) { v_up_min = sink; };
50 inline void setR_up_frac( double r ) { r_up_frac = r; };
52 inline double getStrength() const { return strength; };
53 inline double getDiameter() const { return diameter; };
54 inline double getHeight() const { return height; };
55 inline double getV_up_max() const { return v_up_max; };
56 inline double getV_up_min() const { return v_up_min; };
57 inline double getR_up_frac() const { return r_up_frac; };
59 virtual const char* getTypeString(void) const { return "thermal"; }
60 void getGroundElev(double dt);
64 double get_strength_fac(double alt_frac);
79 double ground_elev_ft; // ground level in ft
80 double altitude_agl_ft; // altitude above ground in feet
86 SGPropertyNode_ptr _surface_wind_from_deg_node;
87 SGPropertyNode_ptr _surface_wind_speed_node;
88 SGPropertyNode_ptr _aloft_wind_from_deg_node;
89 SGPropertyNode_ptr _aloft_wind_speed_node;
93 #endif // _FG_AIThermal_HXX