- double tgt_speed = vApproach;
- distanceOut -= distanceCovered;
- double touchDownPoint = 0; //(rwy->lengthM() * 0.1);
- for (int i = 1; i < nPoints; i++) {
- SGGeod result;
- double currentDist = i * (distanceOut / nPoints);
- //double currentAltitude =
- // apt->getElevation() + 2000 - (i * 2000 / (nPoints-1));
- double alt = currentAltitude - (i * 2000 / (nPoints - 1));
- snprintf(buffer, 16, "final%03d", i);
- result = rwy->pointOnCenterline((-distanceOut) + currentDist + touchDownPoint);
- if (i == nPoints - 30) {
- tgt_speed = vTouchdown;
- }
- wpt = createInAir(ac, buffer, result, alt, tgt_speed);
- wpt->setCrossat(alt);
- wpt->setTrackLength((distanceOut / nPoints));
- // account for the extra distance due to an extended downwind leg
- if (i == 1) {
- wpt->setTrackLength(wpt->getTrackLength() + distanceCovered);
- }
- //cerr << "Track Length : " << wpt->trackLength;
- pushBackWaypoint(wpt);
- //if (apt->ident() == fgGetString("/sim/presets/airport-id")) {
- // cerr << " Position : " << result.getLatitudeDeg() << " " << result.getLongitudeDeg() << " " << currentAltitude << " " << apt->getElevation() << " " << distanceOut << endl;
- //}
- }
-