// 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);
//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);
}
****************/
// 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);