]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment_mgr.cxx
Merge branch 'next' of git://gitorious.org/fg/flightgear into next
[flightgear.git] / src / Environment / environment_mgr.cxx
index 07e834772b165770283cca25e73bff601ce2124f..c810222580c44a5ce75a9f437ba0b65a91dd2b11 100644 (file)
@@ -24,6 +24,8 @@
 #  include <config.h>
 #endif
 
+#include <cstring>
+
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/scene/sky/sky.hxx>
@@ -39,6 +41,7 @@
 #include "environment_ctrl.hxx"
 #include "fgclouds.hxx"
 #include "precipitation_mgr.hxx"
+#include "ridge_lift.hxx"
 
 class SGSky;
 extern SGSky *thesky;
@@ -63,10 +66,18 @@ FGEnvironmentMgr::FGEnvironmentMgr ()
 
   _precipitationManager = new FGPrecipitationMgr;
   set_subsystem("precipitation", _precipitationManager);
+
+  set_subsystem("ridgelift", new FGRidgeLift);
 }
 
 FGEnvironmentMgr::~FGEnvironmentMgr ()
 {
+  SGSubsystem * subsys;
+
+  subsys = get_subsystem( "ridgelift" );
+  remove_subsystem( "ridgelift" );
+  delete subsys;
+
   remove_subsystem("precipitation");
   delete _precipitationManager;
 
@@ -293,19 +304,11 @@ FGEnvironmentMgr::update (double dt)
   _environment->set_elevation_ft(fgGetDouble("/position/altitude-ft"));
   _environment->set_local_weather_lift_fps(fgGetDouble("/local-weather/current/thermal-lift"));
   osg::Vec3 windVec(_environment->get_wind_from_north_fps(),
-                                       -_environment->get_wind_from_east_fps(),
+                    -_environment->get_wind_from_east_fps(),
                     0);
-         // SG_LOG(SG_GENERAL, SG_ALERT, "-_environment->get_wind_from_north_mps() " <<
-                  //_environment->get_wind_from_north_fps() * SG_FEET_TO_METER
-                  //<< " -_environment->get_wind_from_east_mps() " 
-                  //<< -_environment->get_wind_from_east_fps() * SG_FEET_TO_METER
-                  //);
-
   simgear::Particles::setWindVector(windVec * SG_FEET_TO_METER);
-  //double wind_true_deg = _environment->get_wind_from_heading_deg();
-  //simgear::Particles::setWindFrom( wind_true_deg,
-  //                                _environment->get_wind_speed_kt() );
-
+  //simgear::Particles::setWindFrom( _environment->get_wind_from_heading_deg(),
+  //                      _environment->get_wind_speed_kt() );
 }
 
 FGEnvironment