]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/Balloon/BalloonSim.cpp
First steps in a weather reorganization. Note especially that
[flightgear.git] / src / FDM / Balloon / BalloonSim.cpp
index 88dd3a691b9fc2fe8e0b10f2bb592f735943af1f..350298b50e9bc1ab9ab7b723a6a595f20708ff50 100644 (file)
@@ -78,10 +78,10 @@ balloon::balloon()
     /* size for hot air balloons                                           */
     /************************************************************************/
 
-    balloon_envelope_area = 4.0 * (8.8 * 8.8) * FG_PI; 
-    balloon_envelope_volume = (4.0/3.0) * (8.8 * 8.8 * 8.8) * FG_PI;
+    balloon_envelope_area = 4.0 * (8.8 * 8.8) * SGD_PI; 
+    balloon_envelope_volume = (4.0/3.0) * (8.8 * 8.8 * 8.8) * SGD_PI;
 
-    wind_facing_area_of_balloon = FG_PI * (8.8 * 8.8);
+    wind_facing_area_of_balloon = SGD_PI * (8.8 * 8.8);
     wind_facing_area_of_basket = 2.0;  //guessed: 2 m^2
     
     cw_envelope=0.45;                  //a sphere in this case
@@ -169,6 +169,7 @@ void balloon::update()
     /* later, but currently was my main concern to get it going...          */
     /************************************************************************/
 
+#ifndef FG_OLD_WEATHER
     sgVec3 v;
 
     FGPhysicalProperty wdbpos = WeatherDatabase->get(position);
@@ -191,6 +192,13 @@ void balloon::update()
     float k = 1.0 / (1.0/4.8 + 1.0/(4.8+3.4*speed) + l_of_the_envelope/lambda);
     float Q = k * balloon_envelope_area * (dt/3600.0) * (wdbpos.Temperature - T);   //(dt/3600.0) = time since last call in hours
 
+#else
+   // I realy don't think there is a solution for this without WeatherCM
+   // but this is a hack, and it's working -- EMH
+   double mAir = 0;
+   float Q = 0;
+#endif
+
     // gain of energy by heating:
     if (fuel_left > 0.0)       //but only with some fuel left ;-)
     {
@@ -218,8 +226,10 @@ void balloon::update()
     sgVec3 fTotal, fFriction, fLift;
 
     sgScaleVec3(fTotal, gravity_vector, mTotal);
+#ifndef FG_OLD_WEATHER
     sgScaleVec3(fFriction, v, cw_envelope * wind_facing_area_of_balloon * WeatherDatabase->getAirDensity(position) * speed / 2.0);  //wind resistance
     sgScaleVec3(fLift, gravity_vector, -balloon_envelope_volume * wdbpos.AirPressure / (287.14 * wdbpos.Temperature));
+#endif
    
     sgAddVec3(fTotal, fLift);
     sgAddVec3(fTotal, fFriction);