1
0
Fork 0

Fix runway elevations when threshold.xml is used.

SGGeodesy::direct doesn't preserve elevations, oops.
This commit is contained in:
James Turner 2013-01-01 20:58:42 +00:00
parent f48ad2f20b
commit f3dec6a64d
2 changed files with 8 additions and 12 deletions

View file

@ -61,18 +61,15 @@ FGRunwayBase::FGRunwayBase(PositionedID aGuid, Type aTy, const string& aIdent,
SGGeod FGRunwayBase::pointOnCenterline(double aOffset) const SGGeod FGRunwayBase::pointOnCenterline(double aOffset) const
{ {
SGGeod result;
double dummyAz2;
double halfLengthMetres = lengthM() * 0.5; double halfLengthMetres = lengthM() * 0.5;
SGGeodesy::direct(mPosition, _heading, SGGeod result = SGGeodesy::direct(mPosition, _heading,
aOffset - halfLengthMetres, aOffset - halfLengthMetres);
result, dummyAz2); result.setElevationM(mPosition.getElevationM());
return result; return result;
} }
SGGeod FGRunwayBase::pointOffCenterline(double aOffset, double lateralOffset) const SGGeod FGRunwayBase::pointOffCenterline(double aOffset, double lateralOffset) const
{ {
SGGeod result; SGGeod result;

View file

@ -1562,9 +1562,8 @@ void NavDataCache::updateRunwayThreshold(PositionedID runwayID, const SGGeod &aT
// compute the new runway center, based on the threshold lat/lon and length, // compute the new runway center, based on the threshold lat/lon and length,
double offsetFt = (0.5 * d->runwayLengthFt(runwayID)); double offsetFt = (0.5 * d->runwayLengthFt(runwayID));
SGGeod newCenter; SGGeod newCenter= SGGeodesy::direct(aThreshold, aHeading, offsetFt * SG_FEET_TO_METER);
double dummy; newCenter.setElevationM(aThreshold.getElevationM());
SGGeodesy::direct(aThreshold, aHeading, offsetFt * SG_FEET_TO_METER, newCenter, dummy);
// now update the positional data // now update the positional data
updatePosition(runwayID, newCenter); updatePosition(runwayID, newCenter);