]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/runwaybase.cxx
NasalCanvas: Clean up and expose Element node ghost
[flightgear.git] / src / Airports / runwaybase.cxx
index fd82406ad9a0696258a5a034d9551b9d2db783a9..e3e1bf02390ce14426f86c1458a66cc8929246f5 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #include <simgear/compiler.h>
+#include <simgear/props/props.hxx>
 
 #include "runwaybase.hxx"
 
@@ -45,13 +46,12 @@ 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, index)
+                        const int surface_code) :
+  FGPositioned(aGuid, aTy, aIdent, aGeod)
 {
   _heading = heading;
   _length = length;
@@ -71,16 +71,38 @@ 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));
 }
 
-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)
 {
 }