]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Thruster.cpp
Updates to the controls properties tree. This is a major update so there may be one...
[flightgear.git] / src / FDM / YASim / Thruster.cpp
index 6dab8aa3c90e88b9915bd1c96243472be3fa6bc2..20b4a6c7b0c488f48bffc2b55515752537820b8b 100644 (file)
@@ -5,10 +5,12 @@ namespace yasim {
 Thruster::Thruster()
 {
     _dir[0] = 1; _dir[1] = 0; _dir[2] = 0;
-    for(int i=0; i<3; i++) _pos[i] = _wind[i] = 0;
+    int i;
+    for(i=0; i<3; i++) _pos[i] = _wind[i] = 0;
     _throttle = 0;
     _mixture = 0;
-    _P = _T = _rho = 0;
+    _starter = false;
+    _pressure = _temp = _rho = 0;
 }
 
 Thruster::~Thruster()
@@ -17,17 +19,20 @@ Thruster::~Thruster()
 
 void Thruster::getPosition(float* out)
 {
-    for(int i=0; i<3; i++) out[i] = _pos[i];
+    int i;
+    for(i=0; i<3; i++) out[i] = _pos[i];
 }
 
 void Thruster::setPosition(float* pos)
 {
-    for(int i=0; i<3; i++) _pos[i] = pos[i];
+    int i;
+    for(i=0; i<3; i++) _pos[i] = pos[i];
 }
 
 void Thruster::getDirection(float* out)
 {
-    for(int i=0; i<3; i++) out[i] = _dir[i];
+    int i;
+    for(i=0; i<3; i++) out[i] = _dir[i];
 }
 
 void Thruster::setDirection(float* dir)
@@ -45,16 +50,22 @@ void Thruster::setMixture(float mixture)
     _mixture = Math::clamp(mixture, 0, 1);
 }
 
+void Thruster::setStarter(bool starter)
+{
+    _starter = starter;
+}
+
 void Thruster::setWind(float* wind)
 {
-    for(int i=0; i<3; i++) _wind[i] = wind[i];
+    int i;
+    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)
 {
-    _P = pressure;
-    _T = temp;
-    _rho = _P / (287.1 * _T);
+    _pressure = pressure;
+    _temp = temp;
+    _rho = density;
 }
 
 }; // namespace yasim