static const float INHG2PA = 3386.389;
static const float SLUG2KG = 14.59390;
-YASim::YASim(double dt)
+YASim::YASim(double dt) :
+ _simTime(0)
{
// set_delta_t(dt);
_fdm = new FGFDM();
// Run the superclass bind to set up a bunch of property ties
FGInterface::bind();
+//Torsten Dreyer: we shouldn't do this anymore because we don't set these values nomore
// Now UNtie the ones that we are going to set ourselves.
- fgUntie("/consumables/fuel/tank[0]/level-gal_us");
- fgUntie("/consumables/fuel/tank[1]/level-gal_us");
+// fgUntie("/consumables/fuel/tank[0]/level-gal_us");
+// fgUntie("/consumables/fuel/tank[1]/level-gal_us");
char buf[256];
for(int i=0; i<_fdm->getAirplane()->getModel()->numThrusters(); i++) {
// build the environment cache.
float vr = _fdm->getVehicleRadius();
vr += 2.0*FT2M*dt*Math::mag3(v);
- prepare_ground_cache_m( 0.0, xyz, vr );
+ prepare_ground_cache_m( _simTime, _simTime + dt, xyz, vr );
// Track time increments.
FGGround* gr
int i;
for(i=0; i<iterations; i++) {
- gr->setTimeOffset(i*_dt);
+ gr->setTimeOffset(_simTime + i*_dt);
copyToYASim(false);
_fdm->iterate(_dt);
copyFromYASim();
}
- // Reset the time increment.
- gr->setTimeOffset(0.0);
+ // Increment the local sim time
+ _simTime += dt;
+ gr->setTimeOffset(_simTime);
}
void YASim::copyToYASim(bool copyState)