From: durk Date: Wed, 27 Dec 2006 10:02:13 +0000 (+0000) Subject: Change the traffic manager's position calculations to use a spherical X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bd34d34d16fd582eced9ddf0a5851b852dee4df5;p=flightgear.git Change the traffic manager's position calculations to use a spherical earth model instead of WGS84. WGS84 precision is overkill for what the traffic manager requires, and also keeps locking up while computing course and distance for anti podal points in New Zealand vs. south west france. --- diff --git a/src/Traffic/Schedule.cxx b/src/Traffic/Schedule.cxx index 9aa64dc12..6692c8cc8 100644 --- a/src/Traffic/Schedule.cxx +++ b/src/Traffic/Schedule.cxx @@ -348,13 +348,16 @@ bool FGAISchedule::update(time_t now) SGWayPoint current (lon, lat, - (*i)->getCruiseAlt()); + (*i)->getCruiseAlt(), + SGWayPoint::SPHERICAL); SGWayPoint user ( userLongitude, userLatitude, - (*i)->getCruiseAlt()); + (*i)->getCruiseAlt(), + SGWayPoint::SPHERICAL); SGWayPoint dest ( arr->getLongitude(), arr->getLatitude(), - (*i)->getCruiseAlt()); + (*i)->getCruiseAlt(), + SGWayPoint::SPHERICAL); // We really only need distance to user // and course to destination user.CourseAndDistance(current, &courseToUser, &distanceToUser); @@ -474,10 +477,12 @@ double FGAISchedule::getSpeed() SGWayPoint dest ( dep->getLongitude(), dep->getLatitude(), - (*i)->getCruiseAlt()); + (*i)->getCruiseAlt(), + SGWayPoint::SPHERICAL); SGWayPoint curr ( arr->getLongitude(), arr->getLatitude(), - (*i)->getCruiseAlt()); + (*i)->getCruiseAlt(), + SGWayPoint::SPHERICAL); remainingTimeEnroute = (*i)->getArrivalTime() - (*i)->getDepartureTime(); dest.CourseAndDistance(curr, &courseToDest, &distanceToDest); speed = (distanceToDest*SG_METER_TO_NM) /