handleATCRequests(); // ATC also has a word to say
updateSecondaryTargetValues(); // target roll, vertical speed, pitch
updateActualState();
- UpdateRadar(manager);
+ // We currently have one situation in which an AIAircraft object is used that is not attached to the
+ // AI manager. In this particular case, the AIAircraft is used to shadow the user's aircraft's behavior in the AI world.
+ // Since we perhaps don't want a radar entry of our own aircraft, the following conditional should probably be adequate
+ // enough
+ if (manager)
+ UpdateRadar(manager);
checkVisibility();
}
fp->restart();
+ fp->setLeg(leg);
ai_ac.SetFlightPlan(fp);
if (controller) {
controller->announcePosition(ai_ac.getID(), fp, fp->getCurrentWaypoint()->routeIndex,
altitude, time);
//string airport = fgGetString("/sim/presets/airport-id");
//FGAirport *apt = FGAirport::findByIdent(airport);
+ // AT this stage we should update the flightplan, so that waypoint incrementing is conducted as well as leg loading.
+ ai_ac.setLatitude(latitude);
+ ai_ac.setLongitude(longitude);
+ ai_ac.setAltitude(altitude);
+ ai_ac.setHeading(heading);
+ ai_ac.setSpeed(speed);
+ ai_ac.update(time);
controller->render();
//cerr << "Adding groundnetWork to the scenegraph::update" << endl;
}