]> git.mxchange.org Git - flightgear.git/blob - src/Environment/environment.hxx
Updates to the scenery loading infrastructure to make it more flexible,
[flightgear.git] / src / Environment / environment.hxx
1 // environment.hxx -- routines to model the natural environment.
2 //
3 // Written by David Megginson, started February 2002.
4 //
5 // Copyright (C) 2002  David Megginson - david@megginson.com
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #ifndef _ENVIRONMENT_HXX
25 #define _ENVIRONMENT_HXX
26
27 #include <simgear/compiler.h>
28
29 #include <Main/fgfs.hxx>
30
31 #ifdef SG_HAVE_STD_INCLUDES
32 #  include <cmath>
33 #else
34 #  include <math.h>
35 #endif
36
37
38 /**
39  * Model the natural environment.
40  *
41  * This class models the natural environment at a specific place and
42  * time.  A separate instance is necessary for each location or time.
43  *
44  * This class should eventually move to SimGear.
45  */
46 class FGEnvironment
47 {
48
49 public:
50
51   FGEnvironment();
52   virtual ~FGEnvironment();
53   
54   virtual double get_visibility_m () const;
55   virtual double get_temperature_sea_level_degc () const;
56   virtual double get_pressure_sea_level_inhg () const;
57   virtual double get_wind_from_heading_deg () const;
58   virtual double get_wind_speed_kt () const;
59   virtual double get_wind_from_north_fps () const;
60   virtual double get_wind_from_east_fps () const;
61   virtual double get_wind_from_down_fps () const;
62
63   virtual void set_visibility_m (double v);
64   virtual void set_temperature_sea_level_degc (double t);
65   virtual void set_pressure_sea_level_inhg (double p);
66   virtual void set_wind_from_heading_deg (double h);
67   virtual void set_wind_speed_kt (double s);
68   virtual void set_wind_from_north_fps (double n);
69   virtual void set_wind_from_east_fps (double e);
70   virtual void set_wind_from_down_fps (double d);
71
72 private:
73
74   void _recalc_hdgspd ();
75   void _recalc_ne ();
76
77   double visibility_m;
78   double temperature_sea_level_degc;
79   double pressure_sea_level_inhg;
80
81   double wind_from_heading_deg;
82   double wind_speed_kt;
83
84   double wind_from_north_fps;
85   double wind_from_east_fps;
86   double wind_from_down_fps;
87
88                                 // Do these belong here?
89 #if 0
90   GLfloat fog_exp_density;
91   GLfloat fog_exp2_density;
92 #endif
93
94 };
95
96 #endif // _ENVIRONMENT_HXX