]> git.mxchange.org Git - flightgear.git/commitdiff
Change the traffic manager's position calculations to use a spherical
authordurk <durk>
Wed, 27 Dec 2006 10:02:13 +0000 (10:02 +0000)
committerdurk <durk>
Wed, 27 Dec 2006 10:02:13 +0000 (10:02 +0000)
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

index 9aa64dc128f394afe9bb62e6a007e223525f88ae..6692c8cc89d42dc0784ba67b84d0d325591a363a 100644 (file)
@@ -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) /