#include <Scenery/scenery.hxx>
#include <Time/fg_time.hxx>
#include <Time/light.hxx>
+#include <Time/event.hxx>
+#include <Time/sunpos.hxx>
#include <Cockpit/radiostack.hxx>
+#include <Ephemeris/ephemeris.hxx>
#ifndef FG_OLD_WEATHER
# include <WeatherCM/FGLocalWeatherDatabase.h>
#else
FG_USING_NAMESPACE(std);
- // FIXME: these are not part of the
- // published interface!!!
-// extern fgAPDataPtr APDataGlobal;
-// extern void fgAPAltitudeSet (double new_altitude);
-// extern void fgAPHeadingSet (double new_heading);
-
#include "bfi.hxx"
setLatitude(getLatitude());
setLongitude(getLongitude());
setAltitude(getAltitude());
- setTargetAirport("");
+
// TODO: add more AP stuff
double elevator = getElevator();
double aileron = getAileron();
double gpsLatitude = getGPSTargetLatitude();
double gpsLongitude = getGPSTargetLongitude();
+ setTargetAirport("");
+ cout << "Target airport is " << current_options.get_airport_id() << endl;
fgReInitSubsystems();
- // solarSystemRebuild();
+
+ // FIXME: this is wrong.
+ // All of these are scheduled events,
+ // and it should be possible to force
+ // them all to run once.
+ fgUpdateSunPos();
+ fgUpdateMoonPos();
cur_light_params.Update();
+ FGTime::cur_time_params->updateLocal();
+ fgUpdateWeatherDatabase();
+ fgRadioSearch();
// Restore all of the old states.
setElevator(elevator);
FGBFI::setLatitude (double latitude)
{
current_options.set_lat(latitude);
+ current_aircraft.fdm_state->set_Latitude(latitude * DEG_TO_RAD);
needReinit();
}
FGBFI::setLongitude (double longitude)
{
current_options.set_lon(longitude);
+ current_aircraft.fdm_state->set_Longitude(longitude * DEG_TO_RAD);
needReinit();
}
FGBFI::setAltitude (double altitude)
{
current_options.set_altitude(altitude * FEET_TO_METER);
+ current_aircraft.fdm_state->set_Altitude(altitude);
needReinit();
}
FGBFI::setHeading (double heading)
{
current_options.set_heading(heading);
+ current_aircraft.fdm_state->set_Euler_Angles(getRoll() * DEG_TO_RAD,
+ getPitch() * DEG_TO_RAD,
+ heading * DEG_TO_RAD);
needReinit();
}
{
current_options.set_pitch(pitch);
+ current_aircraft.fdm_state->set_Euler_Angles(getRoll() * DEG_TO_RAD,
+ pitch * DEG_TO_RAD,
+ getHeading() * DEG_TO_RAD);
needReinit();
}
FGBFI::setRoll (double roll)
{
current_options.set_roll(roll);
+ current_aircraft.fdm_state->set_Euler_Angles(roll * DEG_TO_RAD,
+ getPitch() * DEG_TO_RAD,
+ getHeading() * DEG_TO_RAD);
needReinit();
}
FGBFI::setSpeedNorth (double speed)
{
current_options.set_uBody(speed);
+ current_aircraft.fdm_state->set_Velocities_Local(speed,
+ getSpeedEast(),
+ getSpeedDown());
needReinit();
}
FGBFI::setSpeedEast (double speed)
{
current_options.set_vBody(speed);
+ current_aircraft.fdm_state->set_Velocities_Local(getSpeedNorth(),
+ speed,
+ getSpeedDown());
needReinit();
}
FGBFI::setSpeedDown (double speed)
{
current_options.set_wBody(speed);
+ current_aircraft.fdm_state->set_Velocities_Local(getSpeedNorth(),
+ getSpeedEast(),
+ speed);
needReinit();
}