+// Set current_options lon/lat given an aircraft carrier id
+static bool fgSetPosFromCarrier( const string& carrier, const string& posid ) {
+
+ // set initial position from runway and heading
+ Point3D geodPos;
+ double heading;
+ sgdVec3 uvw;
+ if (FGAIManager::getStartPosition(carrier, posid, geodPos, heading, uvw)) {
+ double lon = geodPos.lon() * SGD_RADIANS_TO_DEGREES;
+ double lat = geodPos.lat() * SGD_RADIANS_TO_DEGREES;
+ double alt = geodPos.elev() * SG_METER_TO_FEET;
+
+ SG_LOG( SG_GENERAL, SG_INFO, "Attempting to set starting position for "
+ << carrier << " at lat = " << lat << ", lon = " << lon
+ << ", alt = " << alt << ", heading = " << heading);
+
+ fgSetDouble("/sim/presets/longitude-deg", lon);
+ fgSetDouble("/sim/presets/latitude-deg", lat);
+ fgSetDouble("/sim/presets/altitude-ft", alt);
+ fgSetDouble("/sim/presets/heading-deg", heading);
+ fgSetDouble("/position/longitude-deg", lon);
+ fgSetDouble("/position/latitude-deg", lat);
+ fgSetDouble("/position/altitude-ft", alt);
+ fgSetDouble("/orientation/heading-deg", heading);
+
+ fgSetString("/sim/presets/speed-set", "UVW");
+ fgSetDouble("/velocities/uBody-fps", uvw[0]);
+ fgSetDouble("/velocities/vBody-fps", uvw[1]);
+ fgSetDouble("/velocities/wBody-fps", uvw[2]);
+ fgSetDouble("/sim/presets/uBody-fps", uvw[0]);
+ fgSetDouble("/sim/presets/vBody-fps", uvw[1]);
+ fgSetDouble("/sim/presets/wBody-fps", uvw[2]);