Added a post-solver "initEngines()" call to return the engines to a sane
initial state. No more starting up at cruise RPM.
This commit is contained in:
parent
d3cca375dc
commit
df9069a224
6 changed files with 19 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
virtual float getFuelFlow();
|
||||
|
||||
// Runtime instructions
|
||||
virtual void init();
|
||||
virtual void integrate(float dt);
|
||||
virtual void stabilize();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ void YASim::init()
|
|||
copyToYASim(true);
|
||||
|
||||
_fdm->getExternalInput();
|
||||
_fdm->getAirplane()->stabilizeThrust();
|
||||
_fdm->getAirplane()->initEngines();
|
||||
|
||||
set_inited(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue