}
+
+// Set current tower position lon/lat given an airport id
+bool fgSetTowerPosFromAirportID( const string& id, double hdg ) {
+ FGAirport a;
+ // tower height hard coded for now...
+ float towerheight=50.0f;
+
+ // make a little off the heading for 1 runway airports...
+ float fudge_lon = fabs(sin(hdg)) * .003f;
+ float fudge_lat = .003f - fudge_lon;
+
+ if ( fgFindAirportID( id, &a ) ) {
+ fgSetDouble("/sim/tower/longitude-deg", a.longitude + fudge_lon);
+ fgSetDouble("/sim/tower/latitude-deg", a.latitude + fudge_lat);
+ fgSetDouble("/sim/tower/altitude-ft", a.elevation + towerheight);
+ return true;
+ } else {
+ return false;
+ }
+
+}
+
+
// Set current_options lon/lat given an airport id and heading (degrees)
bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg ) {
FGRunway r;
fgSetBool("/sim/freeze/master", false);
}
}
+
// Set pos given an airport id
bool fgSetPosFromAirportID( const string& id );
+// Set tower position given an airport id
+bool fgSetTowerPosFromAirportID( const string& id, double hdg );
+
// Set position and heading given an airport id and heading (degrees)
bool fgSetPosFromAirportIDandHdg( const string& id, double tgt_hdg );
#endif // _FG_INIT_HXX
+
// ADA
// Clip plane settings...
float cockpit_nearplane = 0.01f;
-float cockpit_farplane = 100.0f;
+float cockpit_farplane = 5000.0f;
float scene_nearplane = 0.5f;
float scene_farplane = 120000.0f;
// fgSetPosFromAirportID( fgGetString("/sim/startup/airport-id") );
fgSetPosFromAirportIDandHdg( fgGetString("/sim/startup/airport-id"),
fgGetDouble("/orientation/heading-deg") );
+ // set tower position (a little off the heading for single runway airports)
+ fgSetTowerPosFromAirportID( fgGetString("/sim/startup/airport-id"), fgGetDouble("orientation/heading") );
}
SGTime *t = fgInitTime();
+
#include <simgear/compiler.h>
+#include <fg_props.hxx>
+
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
sgCopyVec3(_zero_elev, _zero_elev_view_pos);
sgCopyVec3(_view_pos, _relative_view_pos);
+ // FIXME:
+ // Doing this last recalc here for published values...where the airplane is
+ // This should be per aircraft or model (for published values) before
+ // multiple FDM can be done.
+ recalcPositionVectors(fgGetDouble("/position/longitude-deg"),
+ fgGetDouble("/position/latitude-deg"),
+ fgGetDouble("/position/altitude-deg"));
+
+
+
// Make the world up rotation matrix for eye positioin...
sgMakeRotMat4( UP, _lon_deg, 0.0, -_lat_deg );
+