X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Frunways.cxx;h=3eb853823e4d39f0927fcba599c71f3d08750217;hb=386aefe69358ce41a11c9afeb8f56e26758fe56b;hp=f97cd14e83aee82c4c4dde7e078d2a77362ba50d;hpb=2dee4ef14ff449381d11ef2d55d07b2e199677af;p=flightgear.git diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index f97cd14e8..3eb853823 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -71,7 +71,8 @@ FGRunway::FGRunway(FGAirport* aAirport, const string& aIdent, bool reciprocal) : FGRunwayBase(RUNWAY, cleanRunwayNo(aIdent), aGeod, heading, length, width, surface_code, true), _airport(aAirport), - _reciprocal(reciprocal), + _isReciprocal(reciprocal), + _reciprocal(NULL), _displ_thresh(displ_thresh), _stopway(stopway), _ils(NULL) @@ -150,11 +151,19 @@ void FGRunway::processThreshold(SGPropertyNode* aThreshold) _displ_thresh = aThreshold->getDoubleValue("displ-m") * SG_METER_TO_FEET; _stopway = aThreshold->getDoubleValue("stopw-m") * SG_METER_TO_FEET; - // compute the new runway center, based on the threshold lat/lon, length, - // and any displaced threshold. - double offsetFt = (0.5 * _length) - _displ_thresh; + // compute the new runway center, based on the threshold lat/lon and length, + double offsetFt = (0.5 * _length); SGGeod newCenter; double dummy; SGGeodesy::direct(newThreshold, _heading, offsetFt * SG_FEET_TO_METER, newCenter, dummy); mPosition = newCenter; } + +void FGRunway::setReciprocalRunway(FGRunway* other) +{ + assert(_reciprocal==NULL); + assert((other->_reciprocal == NULL) || (other->_reciprocal == this)); + + _reciprocal = other; +} +