]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment.hxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Environment / environment.hxx
index f485c16f96317f21a1f6482c1357afb0893dc2da..264072d653e66a1cc9c17e260d048b0be22e07c8 100644 (file)
@@ -26,8 +26,6 @@
 
 #include <simgear/compiler.h>
 
-#include <GL/gl.h>
-
 #include <Main/fgfs.hxx>
 
 #ifdef SG_HAVE_STD_INCLUDES
@@ -36,6 +34,8 @@
 #  include <math.h>
 #endif
 
+class SGInterpTable;
+
 
 /**
  * Model the natural environment.
  *
  * This class should eventually move to SimGear.
  */
-class FGEnvironment : public FGSubsystem
+class FGEnvironment
 {
 
 public:
 
   FGEnvironment();
+  FGEnvironment (const FGEnvironment &environment);
   virtual ~FGEnvironment();
   
-  virtual void init ();
-  virtual void bind ();
-  virtual void unbind ();
-  virtual void update (int dt);
-    
-  inline virtual double get_visibility_m () const { return visibility_m; }
-  inline virtual double get_wind_from_heading_deg () const {
-    return wind_from_heading_deg;
-  }
-  inline virtual double get_wind_speed_kt () const { return wind_speed_kt; }
-  inline virtual double get_wind_from_north_fps () const {
-    return wind_from_north_fps;
-  }
-  inline virtual double get_wind_from_east_fps () const {
-    return wind_from_east_fps;
-  }
-  inline virtual double get_wind_from_down_fps () const {
-    return wind_from_down_fps;
-  }
+  virtual double get_visibility_m () const;
+
+  virtual double get_temperature_sea_level_degc () const;
+  virtual double get_temperature_degc () const;
+  virtual double get_dewpoint_sea_level_degc () const;
+  virtual double get_dewpoint_degc () const;
+  virtual double get_pressure_sea_level_inhg () const;
+  virtual double get_pressure_inhg () const;
+  virtual double get_density_slugft3 () const;
+
+  virtual double get_wind_from_heading_deg () const;
+  virtual double get_wind_speed_kt () const;
+  virtual double get_wind_from_north_fps () const;
+  virtual double get_wind_from_east_fps () const;
+  virtual double get_wind_from_down_fps () const;
 
   virtual void set_visibility_m (double v);
+
+  virtual void set_temperature_sea_level_degc (double t);
+  virtual void set_temperature_degc (double t);
+  virtual void set_dewpoint_sea_level_degc (double d);
+  virtual void set_dewpoint_degc (double d);
+  virtual void set_pressure_sea_level_inhg (double p);
+  virtual void set_pressure_inhg (double p);
+
   virtual void set_wind_from_heading_deg (double h);
   virtual void set_wind_speed_kt (double s);
   virtual void set_wind_from_north_fps (double n);
   virtual void set_wind_from_east_fps (double e);
   virtual void set_wind_from_down_fps (double d);
 
+protected:
+
+  friend class FGEnvironmentMgr;
+
+  virtual double get_elevation_ft () const;
+  virtual void set_elevation_ft (double elevation_ft);
+
 private:
 
+  void _setup_tables ();
+
   void _recalc_hdgspd ();
   void _recalc_ne ();
 
+  void _recalc_sl_temperature ();
+  void _recalc_alt_temperature ();
+  void _recalc_sl_dewpoint ();
+  void _recalc_alt_dewpoint ();
+  void _recalc_sl_pressure ();
+  void _recalc_alt_pressure ();
+  void _recalc_density ();
+
+  SGInterpTable * _temperature_degc_table;
+  SGInterpTable * _pressure_inhg_table;
+
+  double elevation_ft;
+
   double visibility_m;
 
+                               // Atmosphere
+  double temperature_sea_level_degc;
+  double temperature_degc;
+  double dewpoint_sea_level_degc;
+  double dewpoint_degc;
+  double pressure_sea_level_inhg;
+  double pressure_inhg;
+  double density_slugft3;
+
   double wind_from_heading_deg;
   double wind_speed_kt;
 
@@ -94,13 +130,6 @@ private:
   double wind_from_east_fps;
   double wind_from_down_fps;
 
-                               // Do these belong here?
-  GLfloat fog_exp_density;
-  GLfloat fog_exp2_density;
-
 };
 
-// FIXME: move to FGGlobals.
-extern FGEnvironment current_environment;
-
 #endif // _ENVIRONMENT_HXX