]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / Environment / environment.hxx
index 0b29970aa7a8cf8ba00ccf1b249c2f06fd22a14f..264072d653e66a1cc9c17e260d048b0be22e07c8 100644 (file)
@@ -34,6 +34,8 @@
 #  include <math.h>
 #endif
 
+class SGInterpTable;
+
 
 /**
  * Model the natural environment.
@@ -49,37 +51,78 @@ class FGEnvironment
 public:
 
   FGEnvironment();
+  FGEnvironment (const FGEnvironment &environment);
   virtual ~FGEnvironment();
   
-  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;
 
@@ -87,12 +130,6 @@ private:
   double wind_from_east_fps;
   double wind_from_down_fps;
 
-                               // Do these belong here?
-#if 0
-  GLfloat fog_exp_density;
-  GLfloat fog_exp2_density;
-#endif
-
 };
 
 #endif // _ENVIRONMENT_HXX