]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment.cxx
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / Environment / environment.cxx
index a922d834b914cac48f4e970e046f9ed953647aed..9a5755e3db3d7f8cabeaa89a739547c8b28fb71f 100644 (file)
@@ -29,8 +29,6 @@
 
 #include <boost/tuple/tuple.hpp>
 
-#include <plib/sg.h>
-
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/interpolater.hxx>
@@ -142,6 +140,7 @@ void FGEnvironment::_init()
     wind_from_down_fps = 0;
     thermal_lift_fps = 0;
     ridge_lift_fps= 0;
+    local_weather_lift_fps=0;
     altitude_half_to_sun_m = 1000;
     altitude_tropo_top_m = 10000;
 #ifdef USING_TABLES
@@ -184,6 +183,7 @@ FGEnvironment::copy (const FGEnvironment &env)
     wind_from_down_fps = env.wind_from_down_fps;
     thermal_lift_fps = env.thermal_lift_fps;
     ridge_lift_fps= env.ridge_lift_fps;
+    local_weather_lift_fps = env.local_weather_lift_fps;
     turbulence_magnitude_norm = env.turbulence_magnitude_norm;
     turbulence_rate_hz = env.turbulence_rate_hz;
 }
@@ -240,6 +240,7 @@ FGEnvironment::read (const SGPropertyNode * node)
 
     maybe_copy_value(this, node, "turbulence/rate-hz",
                      &FGEnvironment::set_turbulence_rate_hz);
+
     // calculate derived properties here to avoid duplicate expensive computations
     _recalc_ne();
     _recalc_alt_pt();
@@ -371,6 +372,12 @@ FGEnvironment::get_ridge_lift_fps () const
   return ridge_lift_fps;
 }
 
+double
+FGEnvironment::get_local_weather_lift_fps () const
+{
+  return local_weather_lift_fps;
+}
+
 double
 FGEnvironment::get_turbulence_magnitude_norm () const
 {
@@ -526,7 +533,16 @@ FGEnvironment::set_ridge_lift_fps (double ri)
   ridge_lift_fps = ri;
   if( live_update ) {
     _recalc_updraft();
+  }
 }
+
+void
+FGEnvironment::set_local_weather_lift_fps (double lwl)
+{
+  local_weather_lift_fps = lwl;
+  if( live_update ) {
+    _recalc_updraft();
+  }
 }
 
 void
@@ -620,7 +636,7 @@ FGEnvironment::_recalc_ne ()
 void
 FGEnvironment::_recalc_updraft ()
 {
-  wind_from_down_fps = thermal_lift_fps + ridge_lift_fps ;
+  wind_from_down_fps = thermal_lift_fps + ridge_lift_fps + local_weather_lift_fps ;
 }
 
 // Intended to help with the interpretation of METAR data,
@@ -708,7 +724,6 @@ FGEnvironment::_recalc_alt_pt ()
         << "  and "  << temperature_sea_level_degc
         << " :: " << this
         << "  # " << count);
-        ///////////////////////////////////raise(SIGUSR1);
     }
   }
 #endif