]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Thruster.cpp
Sync. w. JSB CVS as of 15/01/2007
[flightgear.git] / src / FDM / YASim / Thruster.cpp
index c288edf5e441af56037c0963ee0a9b9974b6579f..cd57745a60b6d2a2129939cb0c5daf5228388291 100644 (file)
@@ -5,11 +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;
-    _propAdvance = 0;
-    _rho = 0;
+    _starter = false;
+    _pressure = _temp = _rho = 0;
 }
 
 Thruster::~Thruster()
@@ -18,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)
@@ -38,38 +42,31 @@ void Thruster::setDirection(float* dir)
 
 void Thruster::setThrottle(float throttle)
 {
-    _throttle = throttle;
+    _throttle = Math::clamp(throttle, 0, 1);
 }
 
 void Thruster::setMixture(float mixture)
 {
-    _mixture = mixture;
+    _mixture = Math::clamp(mixture, 0, 1);
 }
 
-void Thruster::setPropAdvance(float propAdvance)
-{
-    _propAdvance = propAdvance;
-}
 
-void Thruster::setWind(float* wind)
+void Thruster::setStarter(bool starter)
 {
-    for(int i=0; i<3; i++) _wind[i] = wind[i];
+    _starter = starter;
 }
 
-void Thruster::setDensity(float rho)
+void Thruster::setWind(float* wind)
 {
-    _rho = rho;
+    int i;
+    for(i=0; i<3; i++) _wind[i] = wind[i];
 }
 
-void Thruster::cloneInto(Thruster* out)
+void Thruster::setAir(float pressure, float temp, float density)
 {
-    for(int i=0; i<3; i++) {
-       out->_pos[i] = _pos[i];
-       out->_dir[i] = _dir[i];
-    }
-    out->_throttle = _throttle;
-    out->_mixture  = _mixture;
-    out->_propAdvance = _propAdvance;
+    _pressure = pressure;
+    _temp = temp;
+    _rho = density;
 }
 
 }; // namespace yasim