1
0
Fork 0

Use api's with objects instead of scalars.

Modified Files:
	src/AIModel/AIAircraft.cxx
This commit is contained in:
frohlich 2009-03-07 11:37:29 +00:00 committed by Tim Moore
parent 6c0959468f
commit 6b72986b27

View file

@ -172,8 +172,6 @@ void FGAIAircraft::checkVisibility()
SGWayPoint view (vw->getLongitude_deg(), vw->getLatitude_deg(), 0); SGWayPoint view (vw->getLongitude_deg(), vw->getLatitude_deg(), 0);
view.CourseAndDistance(current, &course, &distance); view.CourseAndDistance(current, &course, &distance);
if (distance > visibility_meters) { if (distance > visibility_meters) {
//aip.getSGLocation()->set_cur_elev_m(aptElev);
//return;
invisible = true; invisible = true;
} else { } else {
invisible = false; invisible = false;
@ -410,20 +408,17 @@ void FGAIAircraft::getGroundElev(double dt) {
SGWayPoint view (vw->getLongitude_deg(), vw->getLatitude_deg(), 0); SGWayPoint view (vw->getLongitude_deg(), vw->getLatitude_deg(), 0);
view.CourseAndDistance(current, &course, &distance); view.CourseAndDistance(current, &course, &distance);
if (distance > visibility_meters) { if (distance > visibility_meters) {
//aip.getSGLocation()->set_cur_elev_m(aptElev);
return; return;
} }
// FIXME: make sure the pos.lat/pos.lon values are in degrees ...
double range = 500.0; 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. // 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; 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; tgt_altitude_ft = alt * SG_METER_TO_FEET;
} }
} }