1
0
Fork 0

Slight change of function api

This commit is contained in:
daveluff 2003-03-31 16:23:23 +00:00
parent e4e6864613
commit fa094c9980
2 changed files with 6 additions and 6 deletions

View 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);
}

View 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);