X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Frunwaybase.cxx;h=4f60682a9a75b36ecaacee90276e70be39349fcd;hb=c068049d840c2f4567c7d07e7fb37247d8e23407;hp=951f860e1db1594c1b583297672152bcccd90924;hpb=87082859d88f9db1bf16d08ede1cb19aa3a251e7;p=flightgear.git diff --git a/src/Airports/runwaybase.cxx b/src/Airports/runwaybase.cxx index 951f860e1..4f60682a9 100644 --- a/src/Airports/runwaybase.cxx +++ b/src/Airports/runwaybase.cxx @@ -1,6 +1,6 @@ // runwaybase.cxx -- a base class for runways and taxiways // -// Written by James Turber, started December 2008. +// Written by James Turner, started December 2008. // // Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt // @@ -46,48 +46,36 @@ using std::string; * 12 - lakebed */ -FGRunwayBase::FGRunwayBase(Type aTy, const string& aIdent, +FGRunwayBase::FGRunwayBase(PositionedID aGuid, Type aTy, const string& aIdent, const SGGeod& aGeod, const double heading, const double length, const double width, - const int surface_code, - bool index) : - FGPositioned(aTy, aIdent, aGeod) + const int surface_code) : + FGPositioned(aGuid, aTy, aIdent, aGeod) { _heading = heading; _length = length; _width = width; _surface_code = surface_code; - - init(index); } SGGeod FGRunwayBase::pointOnCenterline(double aOffset) const { - SGGeod result; - double dummyAz2; - double halfLengthMetres = lengthM() * 0.5; - - SGGeodesy::direct(mPosition, _heading, - aOffset - halfLengthMetres, - result, dummyAz2); + SGGeod result = SGGeodesy::direct(geod(), _heading, aOffset); + result.setElevationM(geod().getElevationM()); + return result; } - - SGGeod FGRunwayBase::pointOffCenterline(double aOffset, double lateralOffset) const { SGGeod result; SGGeod temp; double dummyAz2; - double halfLengthMetres = lengthM() * 0.5; - SGGeodesy::direct(mPosition, _heading, - aOffset - halfLengthMetres, - temp, dummyAz2); + SGGeodesy::direct(geod(), _heading, aOffset, temp, dummyAz2); - SGGeodesy::direct(temp, (_heading+90.0), + SGGeodesy::direct(temp, SGMiscd::normalizePeriodic(0, 360,_heading+90.0), lateralOffset, result, dummyAz2); @@ -100,11 +88,12 @@ bool FGRunwayBase::isHardSurface() const return ((_surface_code == 1) || (_surface_code == 2)); } -FGTaxiway::FGTaxiway(const string& aIdent, +FGTaxiway::FGTaxiway(PositionedID aGuid, + const string& aIdent, const SGGeod& aGeod, const double heading, const double length, const double width, const int surface_code) : - FGRunwayBase(TAXIWAY, aIdent, aGeod, heading, length, width, surface_code, false) + FGRunwayBase(aGuid, TAXIWAY, aIdent, aGeod, heading, length, width, surface_code) { }