# include <config.h>
#endif
+#include <cassert>
#include <simgear/structure/exception.hxx>
#include <FDM/fdm_shell.hxx>
void FDMShell::init()
{
_props = globals->get_props();
+ fgSetBool("/sim/fdm-initialized", false);
createImplementation();
}
void FDMShell::reinit()
{
if (_impl) {
- fgSetBool("/sim/signals/fdm-initialized", false);
+ fgSetBool("/sim/fdm-initialized", false);
evil_global_fdm_state = NULL;
_impl->unbind();
delete _impl;
void FDMShell::unbind()
{
- _impl->unbind();
+ if( _impl ) _impl->unbind();
}
void FDMShell::update(double dt)
double lon = fgGetDouble("/sim/presets/longitude-deg");
double lat = fgGetDouble("/sim/presets/latitude-deg");
- double range = 1000.0; // in metres
+ double range = 1000.0; // in meters
SGGeod geod = SGGeod::fromDeg(lon, lat);
if (globals->get_scenery()->scenery_available(geod, range)) {
SG_LOG(SG_FLIGHT, SG_INFO, "Scenery loaded, will init FDM");
_impl->bind();
evil_global_fdm_state = _impl;
+ fgSetBool("/sim/fdm-initialized", true);
fgSetBool("/sim/signals/fdm-initialized", true);
}
}