+
+
+ // Create an (invisible) AIAircraft represenation of the current
+ // Users, aircraft, that mimicks the user aircraft's behavior.
+ string callsign= fgGetString("/sim/multiplay/callsign");
+ double longitude = fgGetDouble("/position/longitude-deg");
+ double latitude = fgGetDouble("/position/latitude-deg");
+ double altitude = fgGetDouble("/position/altitude-ft");
+ double heading = fgGetDouble("/orientation/heading-deg");
+ double speed = fgGetDouble("/velocities/groundspeed-kt");
+ double aircraftRadius = 40; // note that this is currently hardcoded to a one-size-fits all JumboJet value. Should change later;
+
+
+ ai_ac.setCallSign ( callsign );
+ ai_ac.setLongitude( longitude );
+ ai_ac.setLatitude ( latitude );
+ ai_ac.setAltitude ( altitude );
+ ai_ac.setPerformance("jet_transport");
+
+ // NEXT UP: Create a traffic Schedule and fill that with appropriate information. This we can use to flight plannign.
+ FGAISchedule *trafficRef = new FGAISchedule;
+ trafficRef->setFlightType("gate");
+
+ FGScheduledFlight *flight = new FGScheduledFlight;
+ flight->setDepartureAirport(airport);
+ flight->setArrivalAirport(airport);
+ flight->initializeAirports();
+ flight->setFlightRules("IFR");
+ flight->setCallSign(callsign);
+
+ trafficRef->assign(flight);
+ FGAIFlightPlan *fp = new FGAIFlightPlan;
+ ai_ac.setTrafficRef(trafficRef);
+
+ string flightPlanName = airport + "-" + airport + ".xml";
+ double cruiseAlt = 100; // Doesn't really matter right now.
+ double courseToDest = 180; // Just use something neutral; this value might affect the runway that is used though...
+ time_t deptime = 0; // just make sure how flightplan processing is affected by this...
+