]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Thruster.cpp
FGPUIDialog: fix reading from already free'd memory.
[flightgear.git] / src / FDM / YASim / Thruster.cpp
index 782ff669e957c348f6478645396749ad5926f0c7..cfc31a7a97c200056619874f523a3c17a23f4c73 100644 (file)
@@ -42,7 +42,7 @@ void Thruster::setDirection(float* dir)
 
 void Thruster::setThrottle(float throttle)
 {
-    _throttle = Math::clamp(throttle, 0, 1);
+    _throttle = Math::clamp(throttle, -1, 1);
 }
 
 void Thruster::setMixture(float mixture)
@@ -50,6 +50,7 @@ void Thruster::setMixture(float mixture)
     _mixture = Math::clamp(mixture, 0, 1);
 }
 
+
 void Thruster::setStarter(bool starter)
 {
     _starter = starter;
@@ -61,11 +62,11 @@ void Thruster::setWind(float* wind)
     for(i=0; i<3; i++) _wind[i] = wind[i];
 }
 
-void Thruster::setAir(float pressure, float temp)
+void Thruster::setAir(float pressure, float temp, float density)
 {
     _pressure = pressure;
     _temp = temp;
-    _rho = _pressure / (287.1f * _temp);
+    _rho = density;
 }
 
 }; // namespace yasim