]> git.mxchange.org Git - flightgear.git/blobdiff - src/WeatherCM/FGLocalWeatherDatabase.cpp
- modified FGBinding to keep a local copy of the argument property
[flightgear.git] / src / WeatherCM / FGLocalWeatherDatabase.cpp
index cc4a2a15aeb82431ae45515f3cc1eae99e75616e..36e13f5b5ec7149db18efbd2f2be09ba7d7ddbd1 100644 (file)
@@ -73,6 +73,8 @@ void FGLocalWeatherDatabase::init( const WeatherPrecision visibility,
                                   const DatabaseWorkingType type,
                                   const string &root )
 {
+    FGPhysicalProperties f[2];  //make an standard weather that's the same at the whole world
+
     cerr << "Initializing FGLocalWeatherDatabase\n";
     cerr << "-----------------------------------\n";
 
@@ -145,7 +147,6 @@ void FGLocalWeatherDatabase::init( const WeatherPrecision visibility,
            double x[2] = {0.0,  0.0};  //make an standard weather that's the same at the whole world
            double y[2] = {0.0,  0.0};  //make an standard weather that's the same at the whole world
            double z[2] = {1.0, -1.0};  //make an standard weather that's the same at the whole world
-           FGPhysicalProperties f[2];  //make an standard weather that's the same at the whole world
            database = new SphereInterpolate<FGPhysicalProperties>(2,x,y,z,f);
        }
        break;
@@ -204,7 +205,7 @@ void FGLocalWeatherDatabase::update(const sgVec3& p, const WeatherPrecision dt)
 /****************************************************************************/
 FGPhysicalProperty FGLocalWeatherDatabase::get(const sgVec3& p) const
 {
-    return FGPhysicalProperty(database->Evaluate(p), p[3]);
+    return FGPhysicalProperty(database->Evaluate(p), p[2]);
 }
 
 #ifdef macintosh
@@ -222,7 +223,7 @@ FGPhysicalProperties FGLocalWeatherDatabase::get(const sgVec2& p) const
 
 WeatherPrecision FGLocalWeatherDatabase::getAirDensity(const sgVec3& p) const
 {
-    FGPhysicalProperty dummy(database->Evaluate(p), p[3]);
+    FGPhysicalProperty dummy(database->Evaluate(p), p[2]);
 
     return 
        (dummy.AirPressure*FG_WEATHER_DEFAULT_AIRDENSITY*FG_WEATHER_DEFAULT_TEMPERATURE) / 
@@ -259,13 +260,13 @@ void fgUpdateWeatherDatabase(void)
     sgSetVec3(position, 
         current_aircraft.fdm_state->get_Latitude(),
         current_aircraft.fdm_state->get_Longitude(),
-        current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER);
+        current_aircraft.fdm_state->get_Altitude() * SG_FEET_TO_METER);
     
     WeatherDatabase->update( position );
        
     // get the data on 'the bus' for the FDM
 
-    FGPhysicalProperty porperty = WeatherDatabase->get(position);
+   /*  FGPhysicalProperty porperty = WeatherDatabase->get(position);
 
     current_aircraft.fdm_state->set_Static_temperature( Kelvin2Rankine(porperty.Temperature) );
     current_aircraft.fdm_state->set_Static_pressure( Pascal2psf(porperty.AirPressure) );
@@ -275,7 +276,8 @@ void fgUpdateWeatherDatabase(void)
 #define MSTOFPS  3.2808 //m/s to ft/s
     current_aircraft.fdm_state->set_Velocities_Local_Airmass(porperty.Wind[1]*MSTOFPS,
         porperty.Wind[0]*MSTOFPS,
-        porperty.Wind[2]*MSTOFPS);
+        porperty.Wind[2]*MSTOFPS); */
+
     
 }