X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIFlightPlanCreateCruise.cxx;h=8d9cc8db5e65c9c5e3ef8c52fe21ec3473ca1b76;hb=a4debec12277fcb2d0ac109f1af33f0491af52a7;hp=d2fc62473be08e4e2b5caf54b63f29cc018a007d;hpb=030742fa4ae7d99facb517381da71fa404c4ee2b;p=flightgear.git diff --git a/src/AIModel/AIFlightPlanCreateCruise.cxx b/src/AIModel/AIFlightPlanCreateCruise.cxx index d2fc62473..8d9cc8db5 100755 --- a/src/AIModel/AIFlightPlanCreateCruise.cxx +++ b/src/AIModel/AIFlightPlanCreateCruise.cxx @@ -25,9 +25,6 @@ #include #include -#include "AIFlightPlan.hxx" -#include -#include #include #include @@ -37,6 +34,11 @@ #include #include +#include "AIFlightPlan.hxx" +#include "AIAircraft.hxx" +#include "performancedata.hxx" + + using std::iostream; void FGAIFlightPlan::evaluateRoutePart(double deplat, @@ -310,21 +312,23 @@ void FGAIFlightPlan::createCruise(bool firstFlight, FGAirport *dep, * Note that this is the original version that does not * do any dynamic route computation. ******************************************************************/ -void FGAIFlightPlan::createCruise(bool firstFlight, FGAirport *dep, +void FGAIFlightPlan::createCruise(FGAIAircraft *ac, bool firstFlight, FGAirport *dep, FGAirport *arr, double latitude, double longitude, double speed, double alt, const string& fltType) { + double vCruise = ac->getPerformance()->vCruise(); waypoint *wpt; - wpt = createInAir("Cruise", SGGeod::fromDeg(longitude, latitude), alt, speed); + wpt = createInAir(ac, "Cruise", SGGeod::fromDeg(longitude, latitude), alt, vCruise); waypoints.push_back(wpt); string rwyClass = getRunwayClassFromTrafficType(fltType); - arr->getDynamics()->getActiveRunway(rwyClass, 2, activeRunway); + double heading = ac->getTrafficRef()->getCourse(); + arr->getDynamics()->getActiveRunway(rwyClass, 2, activeRunway, heading); rwy = arr->getRunwayByIdent(activeRunway); // begin descent 110km out SGGeod beginDescentPoint = rwy->pointOnCenterline(-110000); - wpt = createInAir("BOD", beginDescentPoint, alt, speed); + wpt = createInAir(ac, "BOD", beginDescentPoint, alt, vCruise); waypoints.push_back(wpt); }