Slight change of function api
This commit is contained in:
parent
e4e6864613
commit
fa094c9980
2 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue