X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATC%2Fatc_mgr.cxx;h=917d25cbb4178632e0081ba3b0b2d3ab80c17cec;hb=17fececa9febd1af9a83ebf89afbe8839043a9c6;hp=dace2d26caa9526572c20e749f0a22bbaca9f95a;hpb=65e87bf2f80a5cd7d4b0f71084f3cbf9a4f7cb82;p=flightgear.git diff --git a/src/ATC/atc_mgr.cxx b/src/ATC/atc_mgr.cxx index dace2d26c..917d25cbb 100644 --- a/src/ATC/atc_mgr.cxx +++ b/src/ATC/atc_mgr.cxx @@ -149,6 +149,7 @@ void FGATCManager::init() { fp->restart(); + fp->setLeg(leg); ai_ac.SetFlightPlan(fp); if (controller) { controller->announcePosition(ai_ac.getID(), fp, fp->getCurrentWaypoint()->routeIndex, @@ -157,9 +158,9 @@ void FGATCManager::init() { //dialog.init(); - osg::Node* node = apt->getDynamics()->getGroundNetwork()->getRenderNode(); - cerr << "Adding groundnetWork to the scenegraph" << endl; - globals->get_scenery()->get_scene_graph()->addChild(node); + //osg::Node* node = apt->getDynamics()->getGroundNetwork()->getRenderNode(); + //cerr << "Adding groundnetWork to the scenegraph::init" << endl; + //globals->get_scenery()->get_scene_graph()->addChild(node); } } @@ -177,18 +178,24 @@ void FGATCManager::update ( double time ) { double speed = fgGetDouble("/velocities/groundspeed-kt"); double altitude = fgGetDouble("/position/altitude-ft"); - cerr << "Running FGATCManager::update()" << endl; + //cerr << "Running FGATCManager::update()" << endl; controller->updateAircraftInformation(ai_ac.getID(), latitude, longitude, heading, speed, altitude, time); - } - /*string airport = fgGetString("/sim/presets/airport-id"); - FGAirport *apt = FGAirport::findByIdent(airport); - osg::Node* node = apt->getDynamics()->getGroundNetwork()->getRenderNode(); - cerr << "Adding groundnetWork to the scenegraph" << endl; - globals->get_scenery()->get_scene_graph()->addChild(node); -*/ + //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; + } + //globals->get_scenery()->get_scene_graph()->addChild(node); }