-// Set initial position and orientation
-bool fgInitPosition( void ) {
- FGInterface *f = current_aircraft.fdm_state;
- string id = fgGetString("/sim/startup/airport-id");
-
- // set initial position from default or command line coordinates
- f->set_Longitude( fgGetDouble("/position/longitude") * SGD_DEGREES_TO_RADIANS );
- f->set_Latitude( fgGetDouble("/position/latitude") * SGD_DEGREES_TO_RADIANS );
-
- SG_LOG( SG_GENERAL, SG_INFO,
- "scenery.cur_elev = " << scenery.cur_elev );
- SG_LOG( SG_GENERAL, SG_INFO,
- "/position/altitude = " << fgGetDouble("/position/altitude") );
-
- // if we requested on ground startups
- if ( fgGetBool( "/sim/startup/onground" ) ) {
- fgSetDouble( "/position/altitude", (scenery.cur_elev + 1)
- * METERS_TO_FEET );
- }
-
- // if requested altitude is below ground level
- if ( scenery.cur_elev >
- fgGetDouble("/position/altitude") * METERS_TO_FEET - 1) {
- fgSetDouble("/position/altitude",
- (scenery.cur_elev + 1) * METERS_TO_FEET );
- }
-
- SG_LOG( SG_GENERAL, SG_INFO,
- "starting altitude is = " <<
- fgGetDouble("/position/altitude") );
-
- f->set_Altitude( fgGetDouble("/position/altitude") );
- SG_LOG( SG_GENERAL, SG_INFO,
- "Initial position is: ("
- << (f->get_Longitude() * SGD_RADIANS_TO_DEGREES) << ", "
- << (f->get_Latitude() * SGD_RADIANS_TO_DEGREES) << ", "
- << (f->get_Altitude() * SG_FEET_TO_METER) << ")" );
-
- return true;
-}
-
-