~jtaylor/ubuntu/oneiric/flightgear/fix-749249

« back to all changes in this revision

Viewing changes to src/Navaids/navdb.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-11-26 12:31:23 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20051126123123-dhs3dijy6nd257up
Tags: 0.9.8-3ubuntu1
adapt gl/glu dependencies for Xorg

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
//
3
3
// Written by Curtis Olson, started May 2004.
4
4
//
5
 
// Copyright (C) 2004  Curtis L. Olson - curt@flightgear.org
 
5
// Copyright (C) 2004  Curtis L. Olson - http://www.flightgear.org/~curt
6
6
//
7
7
// This program is free software; you can redistribute it and/or
8
8
// modify it under the terms of the GNU General Public License as
18
18
// along with this program; if not, write to the Free Software
19
19
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
20
//
21
 
// $Id: navdb.cxx,v 1.4 2004/06/09 03:13:13 curt Exp $
 
21
// $Id: navdb.cxx,v 1.6 2004/12/22 23:57:08 curt Exp $
22
22
 
23
23
 
24
24
#include <simgear/compiler.h>
96
96
            // cout << r->get_type() << " " << r->get_apt_id() << " zero elev"
97
97
            //      << endl;
98
98
            FGAirport a = airports->search( r->get_apt_id() );
99
 
            if ( a.id == r->get_apt_id() ) {
100
 
                r->set_elev_ft( a.elevation );
 
99
            if ( a._id == r->get_apt_id() ) {
 
100
                r->set_elev_ft( a._elevation );
101
101
                // cout << "  setting to " << a.elevation << endl;
102
102
            }
103
103
        }
137
137
static void update_loc_position( FGNavRecord *loc, FGRunway *rwy,
138
138
                                 double threshold )
139
139
{
140
 
    double hdg = rwy->heading;
 
140
    double hdg = rwy->_heading;
141
141
    hdg += 180.0;
142
142
    if ( hdg > 360.0 ) {
143
143
        hdg -= 360.0;
145
145
 
146
146
    // calculate runway threshold point
147
147
    double thresh_lat, thresh_lon, return_az;
148
 
    geo_direct_wgs_84 ( 0.0, rwy->lat, rwy->lon, hdg,
149
 
                        rwy->length/2.0 * SG_FEET_TO_METER,
 
148
    geo_direct_wgs_84 ( 0.0, rwy->_lat, rwy->_lon, hdg,
 
149
                        rwy->_length/2.0 * SG_FEET_TO_METER,
150
150
                        &thresh_lat, &thresh_lon, &return_az );
151
151
    // cout << "Threshold = " << thresh_lat << "," << thresh_lon << endl;
152
152
 
170
170
    // cout << "Distance moved = " << dist_m << endl;
171
171
 
172
172
    // cout << "orig heading = " << loc->get_multiuse() << endl;
173
 
    // cout << "new heading = " << rwy->heading << endl;
 
173
    // cout << "new heading = " << rwy->_heading << endl;
174
174
 
175
 
    double hdg_diff = loc->get_multiuse() - rwy->heading;
 
175
    double hdg_diff = loc->get_multiuse() - rwy->_heading;
176
176
 
177
177
    // clamp to [-180.0 ... 180.0]
178
178
    if ( hdg_diff < -180.0 ) {
184
184
    if ( fabs(hdg_diff) <= threshold ) {
185
185
        loc->set_lat( nloc_lat );
186
186
        loc->set_lon( nloc_lon );
187
 
        loc->set_multiuse( rwy->heading );
 
187
        loc->set_multiuse( rwy->_heading );
188
188
    }
189
189
}
190
190