X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Frunwaybase.cxx;h=01855347c620c407ed5695a9f639a0621d54eda0;hb=16ba5f713b54ce27a3837a96f8816b9730970c44;hp=fd82406ad9a0696258a5a034d9551b9d2db783a9;hpb=43c47f3823faa0829aada79d64a26c2960d2a1d2;p=flightgear.git diff --git a/src/Airports/runwaybase.cxx b/src/Airports/runwaybase.cxx index fd82406ad..01855347c 100644 --- a/src/Airports/runwaybase.cxx +++ b/src/Airports/runwaybase.cxx @@ -51,12 +51,14 @@ FGRunwayBase::FGRunwayBase(Type aTy, const string& aIdent, const double width, const int surface_code, bool index) : - FGPositioned(aTy, aIdent, aGeod, index) + FGPositioned(aTy, aIdent, aGeod) { _heading = heading; _length = length; _width = width; _surface_code = surface_code; + + init(index); } SGGeod FGRunwayBase::pointOnCenterline(double aOffset) const @@ -71,6 +73,27 @@ SGGeod FGRunwayBase::pointOnCenterline(double aOffset) const 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(temp, (_heading+90.0), + lateralOffset, + result, dummyAz2); + + return result; +} + + bool FGRunwayBase::isHardSurface() const { return ((_surface_code == 1) || (_surface_code == 2));