]> git.mxchange.org Git - flightgear.git/commitdiff
Added a post-solver "initEngines()" call to return the engines to a sane
authorandy <andy>
Wed, 27 Feb 2002 00:41:57 +0000 (00:41 +0000)
committerandy <andy>
Wed, 27 Feb 2002 00:41:57 +0000 (00:41 +0000)
initial state.  No more starting up at cruise RPM.

src/FDM/YASim/Airplane.cpp
src/FDM/YASim/Airplane.hpp
src/FDM/YASim/PropEngine.cpp
src/FDM/YASim/PropEngine.hpp
src/FDM/YASim/Thruster.hpp
src/FDM/YASim/YASim.cxx

index 7515dc6392594aaf316e08d2c64e7a2127b5b0f0..7132772aaad2c0b3a974fd18538396831c312107 100644 (file)
@@ -650,6 +650,14 @@ void Airplane::solveGear()
     }
 }
 
+void Airplane::initEngines()
+{
+    for(int i=0; i<_thrusters.size(); i++) {
+        ThrustRec* tr = (ThrustRec*)_thrusters.get(i);
+       tr->thruster->init();
+    }
+}
+
 void Airplane::stabilizeThrust()
 {
     int i;
index e1901af7696856757a21e3eeecc33145da411daa..cf088f1b9014e876ecb22d8df3304b6faa238746 100644 (file)
@@ -59,6 +59,7 @@ public:
     float getFuelDensity(int tank); // kg/m^3
 
     void compile(); // generate point masses & such, then solve
+    void initEngines();
     void stabilizeThrust();
 
     // Solution output values
index 0c5c5e34f61d63863f8cc6c53fdc99dac99f829f..32812f5f6c51966a2850a559bf12b502a97e8a56 100644 (file)
@@ -123,6 +123,13 @@ void PropEngine::stabilize()
     _eng->setRunning(false);
 }
 
+void PropEngine::init()
+{
+    _omega = 0.01;
+    _eng->setStarter(false);
+    _eng->setMagnetos(0);
+}
+
 void PropEngine::integrate(float dt)
 {
     float speed = -Math::dot3(_wind, _dir);
index 11cdb914d10c1a8c596bf713d2a786668df8dd59..3e4cced64a879ff30b453240b6bccf195c85fa91 100644 (file)
@@ -30,6 +30,7 @@ public:
     virtual float getFuelFlow();
 
     // Runtime instructions
+    virtual void init();
     virtual void integrate(float dt);
     virtual void stabilize();
 
index 953c2eb0104964b5f1ced5e754c34a1d478f7232..b461ad1d5bfbba8103dd6739b7863eeebe37adc4 100644 (file)
@@ -43,6 +43,7 @@ public:
     // Runtime instructions
     void setWind(float* wind);
     void setAir(float pressure, float temp);
+    virtual void init() {}
     virtual void integrate(float dt)=0;
     virtual void stabilize()=0;
 
index 9b7fdf16e116ea945d92c65d67db1eac16ba945e..e2b6d1e093bab268c863aa6fce43d5efe0652a90 100644 (file)
@@ -189,7 +189,7 @@ void YASim::init()
     copyToYASim(true);
 
     _fdm->getExternalInput();
-    _fdm->getAirplane()->stabilizeThrust();
+    _fdm->getAirplane()->initEngines();
 
     set_inited(true);
 }