]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment_mgr.cxx
Add aubmodels to AI objects
[flightgear.git] / src / Environment / environment_mgr.cxx
index acf20b861ed86f18059c2991cf8401dc874b84a6..98184acf97112a3c9216b96051180e1ec5a0ff14 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>
@@ -32,7 +34,6 @@
 
 #include <Main/main.hxx>
 #include <Main/fg_props.hxx>
-#include <Aircraft/aircraft.hxx>
 #include <FDM/flight.hxx>
 
 #include "environment.hxx"
@@ -90,7 +91,7 @@ FGEnvironmentMgr::init ()
 {
   SG_LOG( SG_GENERAL, SG_INFO, "Initializing environment subsystem");
   SGSubsystemGroup::init();
-  _update_fdm();
+  //_update_fdm();
 }
 
 void
@@ -98,7 +99,7 @@ FGEnvironmentMgr::reinit ()
 {
   SG_LOG( SG_GENERAL, SG_INFO, "Reinitializing environment subsystem");
   SGSubsystemGroup::reinit();
-  _update_fdm();
+  //_update_fdm();
 }
 
 void
@@ -290,20 +291,15 @@ void
 FGEnvironmentMgr::update (double dt)
 {
   SGSubsystemGroup::update(dt);
-
-                               // FIXME: the FDMs should update themselves
-  current_aircraft.fdm_state
-    ->set_Velocities_Local_Airmass(_environment->get_wind_from_north_fps(),
-                                  _environment->get_wind_from_east_fps(),
-                                  _environment->get_wind_from_down_fps());
+  
   _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(),
+  osg::Vec3 windVec(_environment->get_wind_from_north_fps(),
                     -_environment->get_wind_from_east_fps(),
-                    _environment->get_wind_from_down_fps());
+                    0);
   simgear::Particles::setWindVector(windVec * SG_FEET_TO_METER);
-
-  _update_fdm();
+  //simgear::Particles::setWindFrom( _environment->get_wind_from_heading_deg(),
+  //                      _environment->get_wind_speed_kt() );
 }
 
 FGEnvironment
@@ -335,27 +331,6 @@ FGEnvironmentMgr::getEnvironment(const SGGeod& aPos) const
 
 }
 
-void
-FGEnvironmentMgr::_update_fdm () const
-{
-  //
-  // Pass atmosphere on to FDM
-  // FIXME: have FDMs read properties directly.
-  //
-  if (fgGetBool("/environment/params/control-fdm-atmosphere")) {
-                               // convert from Rankine to Celsius
-    cur_fdm_state
-      ->set_Static_temperature((9.0/5.0)
-                              * (_environment->get_temperature_degc() + 273.15));
-                               // convert from inHG to PSF
-    cur_fdm_state
-      ->set_Static_pressure(_environment->get_pressure_inhg() * 70.726566);
-                               // keep in slugs/ft^3
-    cur_fdm_state
-      ->set_Density(_environment->get_density_slugft3());
-  }
-}
-
 double
 FGEnvironmentMgr::get_cloud_layer_span_m (int index) const
 {