From 6b72986b276290073ae3fd1e889bf59b647c03e1 Mon Sep 17 00:00:00 2001 From: frohlich Date: Sat, 7 Mar 2009 11:37:29 +0000 Subject: [PATCH] Use api's with objects instead of scalars. Modified Files: src/AIModel/AIAircraft.cxx --- src/AIModel/AIAircraft.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index 3f8bb05a8..e7258d60e 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -172,8 +172,6 @@ void FGAIAircraft::checkVisibility() SGWayPoint view (vw->getLongitude_deg(), vw->getLatitude_deg(), 0); view.CourseAndDistance(current, &course, &distance); if (distance > visibility_meters) { - //aip.getSGLocation()->set_cur_elev_m(aptElev); - //return; invisible = true; } else { invisible = false; @@ -410,20 +408,17 @@ void FGAIAircraft::getGroundElev(double dt) { SGWayPoint view (vw->getLongitude_deg(), vw->getLatitude_deg(), 0); view.CourseAndDistance(current, &course, &distance); if (distance > visibility_meters) { - //aip.getSGLocation()->set_cur_elev_m(aptElev); return; } - // FIXME: make sure the pos.lat/pos.lon values are in degrees ... double range = 500.0; - if (!globals->get_tile_mgr()->scenery_available(pos.getLatitudeDeg(), pos.getLongitudeDeg(), range)) { + if (!globals->get_tile_mgr()->scenery_available(pos, range)) { // Try to shedule tiles for that position. - globals->get_tile_mgr()->update( aip.getSGLocation(), range ); + globals->get_tile_mgr()->update( pos, range ); } - // FIXME: make sure the pos.lat/pos.lon values are in degrees ... double alt; - if (globals->get_scenery()->get_elevation_m(pos.getLatitudeDeg(), pos.getLongitudeDeg(), 20000.0, alt, 0)) + if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(pos, 20000), alt, 0)) tgt_altitude_ft = alt * SG_METER_TO_FEET; } } -- 2.39.5