]> git.mxchange.org Git - flightgear.git/commitdiff
Slight change of function api
authordaveluff <daveluff>
Mon, 31 Mar 2003 16:23:23 +0000 (16:23 +0000)
committerdaveluff <daveluff>
Mon, 31 Mar 2003 16:23:23 +0000 (16:23 +0000)
src/ATC/ATCutils.cxx
src/ATC/ATCutils.hxx

index 59b32f2ab5a15ac27d2bf9e2b75a1b1d97d87d7c..1c182357e1d6929f0acce167719545c235c6afd7 100644 (file)
@@ -284,10 +284,10 @@ double dclGetAirportElev( const string& id ) {
 
 // Runway stuff
 // Given a Point3D (lon/lat/elev) and an FGRunway struct, determine if the point lies on the runway
-bool OnRunway(Point3D pt, FGRunway* rwy) {
+bool OnRunway(Point3D pt, const FGRunway& rwy) {
        FGATCAlignedProjection ortho;
-       Point3D centre(rwy->lon, rwy->lat, 0.0);        // We don't need the elev
-       ortho.Init(centre, rwy->heading);
+       Point3D centre(rwy.lon, rwy.lat, 0.0);  // We don't need the elev
+       ortho.Init(centre, rwy.heading);
        
        Point3D xyc = ortho.ConvertToLocal(centre);
        Point3D xyp = ortho.ConvertToLocal(pt);
@@ -295,8 +295,8 @@ bool OnRunway(Point3D pt, FGRunway* rwy) {
        //cout << "Length offset = " << fabs(xyp.y() - xyc.y()) << '\n';
        //cout << "Width offset = " << fabs(xyp.x() - xyc.x()) << '\n';
        
-       if((fabs(xyp.y() - xyc.y()) < ((rwy->length/2.0) + 5.0)) 
-               && (fabs(xyp.x() - xyc.x()) < (rwy->width/2.0))) {
+       if((fabs(xyp.y() - xyc.y()) < ((rwy.length/2.0) + 5.0)) 
+               && (fabs(xyp.x() - xyc.x()) < (rwy.width/2.0))) {
                return(true);
        }
        
index 360ecd8378d53da06a7810f86e485d59a89727d3..b487390472f8619b7cb62d223128ee9f70b5ff6b 100644 (file)
@@ -100,5 +100,5 @@ double dclGetAirportElev( const string& id );
 ****************/
 
 // Given a Point3D (lon/lat/elev) and an FGRunway struct, determine if the point lies on the runway
-bool OnRunway(Point3D pt, FGRunway* rwy);
+bool OnRunway(Point3D pt, const FGRunway& rwy);