From bd34d34d16fd582eced9ddf0a5851b852dee4df5 Mon Sep 17 00:00:00 2001 From: durk Date: Wed, 27 Dec 2006 10:02:13 +0000 Subject: [PATCH] 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. --- src/Traffic/Schedule.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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) /