Export a "/sim/crashed" property to indicate a crash.
Yanked some ancient debug code and cleaned up some whitespace while I was in there.
This commit is contained in:
parent
cdbfda256e
commit
d0af0c5f58
2 changed files with 9 additions and 36 deletions
|
@ -37,32 +37,6 @@ static const float W2HP = 1.3416e-3;
|
|||
static const float INHG2PA = 3386.389;
|
||||
static const float SLUG2KG = 14.59390;
|
||||
|
||||
void YASim::printDEBUG()
|
||||
{
|
||||
static int debugCount = 0;
|
||||
|
||||
debugCount++;
|
||||
if(debugCount >= 3) {
|
||||
debugCount = 0;
|
||||
|
||||
// printf("N1 %5.1f N2 %5.1f FF %7.1f EPR %4.2f EGT %6.1f\n",
|
||||
// fgGetFloat("/engines/engine[0]/n1"),
|
||||
// fgGetFloat("/engines/engine[0]/n2"),
|
||||
// fgGetFloat("/engines/engine[0]/fuel-flow-gph"),
|
||||
// fgGetFloat("/engines/engine[0]/epr"),
|
||||
// fgGetFloat("/engines/engine[0]/egt"));
|
||||
|
||||
// printf("gear: %f\n", fgGetFloat("/controls/gear/gear-down"));
|
||||
|
||||
// printf("alpha %5.1f beta %5.1f\n", get_Alpha()*57.3, get_Beta()*57.3);
|
||||
|
||||
// printf("pilot: %f %f %f\n",
|
||||
// fgGetDouble("/sim/view/pilot/x-offset-m"),
|
||||
// fgGetDouble("/sim/view/pilot/y-offset-m"),
|
||||
// fgGetDouble("/sim/view/pilot/z-offset-m"));
|
||||
}
|
||||
}
|
||||
|
||||
YASim::YASim(double dt)
|
||||
{
|
||||
// set_delta_t(dt);
|
||||
|
@ -219,21 +193,22 @@ void YASim::init()
|
|||
void YASim::update(double dt)
|
||||
{
|
||||
if (is_suspended())
|
||||
return;
|
||||
return;
|
||||
|
||||
int iterations = _calc_multiloop(dt);
|
||||
|
||||
// If we're crashed, then we don't care
|
||||
if(_fdm->getAirplane()->getModel()->isCrashed())
|
||||
return;
|
||||
if(_fdm->getAirplane()->getModel()->isCrashed()) {
|
||||
if(!fgGetBool("/sim/crashed"))
|
||||
fgSetBool("/sim/crashed", true);
|
||||
return;
|
||||
}
|
||||
|
||||
int i;
|
||||
for(i=0; i<iterations; i++) {
|
||||
copyToYASim(false);
|
||||
_fdm->iterate(_dt);
|
||||
copyFromYASim();
|
||||
|
||||
printDEBUG();
|
||||
copyToYASim(false);
|
||||
_fdm->iterate(_dt);
|
||||
copyFromYASim();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@ public:
|
|||
void copyFromYASim();
|
||||
void copyToYASim(bool copyState);
|
||||
|
||||
void printDEBUG();
|
||||
|
||||
yasim::FGFDM* _fdm;
|
||||
float _dt;
|
||||
enum {
|
||||
|
|
Loading…
Reference in a new issue