From: James Turner Date: Mon, 24 Dec 2012 20:22:58 +0000 (+0000) Subject: Fix altitudes on default SIDs and approaches. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e248ea81837c6c0af4e0a023e7fbc37e88a72c40;p=flightgear.git Fix altitudes on default SIDs and approaches. Thanks to Hyde for noticing I had set the elevations incorrectly. --- diff --git a/src/Autopilot/route_mgr.cxx b/src/Autopilot/route_mgr.cxx index 524bffa90..b084c45ad 100644 --- a/src/Autopilot/route_mgr.cxx +++ b/src/Autopilot/route_mgr.cxx @@ -926,21 +926,24 @@ flightgear::SID* createDefaultSID(FGRunway* aRunway) ss << aRunway->ident() << "-3"; SGGeod p = aRunway->pointOnCenterline(aRunway->lengthM() + (3.0 * SG_NM_TO_METER)); - p.setElevationFt(runwayElevFt + 2000.0); - wpts.push_back(new BasicWaypt(p, ss.str(), NULL)); + WayptRef w = new BasicWaypt(p, ss.str(), NULL); + w->setAltitude(runwayElevFt + 2000.0, RESTRICT_AT); + wpts.push_back(w); ss.str(""); ss << aRunway->ident() << "-6"; p = aRunway->pointOnCenterline(aRunway->lengthM() + (6.0 * SG_NM_TO_METER)); - p.setElevationFt(runwayElevFt + 4000.0); - wpts.push_back(new BasicWaypt(p, ss.str(), NULL)); - - ss.str(""); - ss << aRunway->ident() << "-9"; - p = aRunway->pointOnCenterline(aRunway->lengthM() + (9.0 * SG_NM_TO_METER)); - p.setElevationFt(runwayElevFt + 6000.0); - wpts.push_back(new BasicWaypt(p, ss.str(), NULL)); - + w = new BasicWaypt(p, ss.str(), NULL); + w->setAltitude(runwayElevFt + 4000.0, RESTRICT_AT); + wpts.push_back(w); + + ss.str(""); + ss << aRunway->ident() << "-9"; + p = aRunway->pointOnCenterline(aRunway->lengthM() + (9.0 * SG_NM_TO_METER)); + w = new BasicWaypt(p, ss.str(), NULL); + w->setAltitude(runwayElevFt + 6000.0, RESTRICT_AT); + wpts.push_back(w); + BOOST_FOREACH(Waypt* w, wpts) { w->setFlag(WPT_DEPARTURE); w->setFlag(WPT_GENERATED); @@ -1046,22 +1049,24 @@ flightgear::Approach* createDefaultApproach(FGRunway* aRunway) ss << aRunway->ident() << "-12"; WayptVec wpts; SGGeod p = aRunway->pointOnCenterline(-12.0 * SG_NM_TO_METER); - p.setElevationFt(thresholdElevFt + 4000); - wpts.push_back(new BasicWaypt(p, ss.str(), NULL)); + WayptRef w = new BasicWaypt(p, ss.str(), NULL); + w->setAltitude(thresholdElevFt + 4000, RESTRICT_AT); + wpts.push_back(w); p = aRunway->pointOnCenterline(-8.0 * SG_NM_TO_METER); - p.setElevationFt(thresholdElevFt + approachHeightFt); ss.str(""); ss << aRunway->ident() << "-8"; - wpts.push_back(new BasicWaypt(p, ss.str(), NULL)); + w = new BasicWaypt(p, ss.str(), NULL); + w->setAltitude(thresholdElevFt + approachHeightFt, RESTRICT_AT); + wpts.push_back(w); - p = aRunway->pointOnCenterline(-glideslopeDistanceM); - p.setElevationFt(thresholdElevFt + approachHeightFt); - + p = aRunway->pointOnCenterline(-glideslopeDistanceM); ss.str(""); ss << aRunway->ident() << "-GS"; - wpts.push_back(new BasicWaypt(p, ss.str(), NULL)); + w = new BasicWaypt(p, ss.str(), NULL); + w->setAltitude(thresholdElevFt + approachHeightFt, RESTRICT_AT); + wpts.push_back(w); BOOST_FOREACH(Waypt* w, wpts) { w->setFlag(WPT_APPROACH);