1 // FGAILocalTraffic - AIEntity derived class with enough logic to
2 // fly and interact with the traffic pattern.
4 // Written by David Luff, started March 2002.
6 // Copyright (C) 2002 David C. Luff - david.luff@nottingham.ac.uk
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 /*****************************************************************
24 * WARNING - Curt has some ideas about AI traffic so anything in here
25 * may get rewritten or scrapped. Contact Curt curt@flightgear.org
26 * before spending any time or effort on this code!!!
28 ******************************************************************/
30 #ifndef _FG_AILocalTraffic_HXX
31 #define _FG_AILocalTraffic_HXX
35 #include <simgear/math/point3d.hxx>
38 #include "AIEntity.hxx"
40 typedef enum pattern_leg {
54 class FGAILocalTraffic : public FGAIEntity {
64 // Run the internal calculations
69 char* airport; // The ICAO code of the airport that we're operating around
70 double freq; // The frequency that we're operating on - might not need this eventually
71 FGTower* tower; // A pointer to the tower control.
73 double mag_hdg; // degrees - the heading that the physical aircraft is pointing
74 double mag_var; // degrees
76 double vel; // velocity along track in m/s
77 double track; // track - degrees relative to *magnetic* north
78 double slope; // Actual slope that the plane is flying (degrees) - +ve is uphill
79 double AoA; // degrees - difference between slope and pitch
80 // We'll assume that the plane doesn't yaw or slip - the track/heading difference is to allow for wind
82 // Performance characteristics of the plane in knots and ft/min
84 double best_rate_of_climb_speed;
85 double best_rate_of_climb;
86 double nominal_climb_speed;
87 double nominal_climb_rate;
88 double nominal_circuit_speed;
89 double min_circuit_speed;
90 double max_circuit_speed;
91 double nominal_descent_rate;
92 double nominal_approach_speed;
93 double stall_speed_landing_config;
95 // OK, what do we need to know whilst flying the pattern
100 #endif // _FG_AILocalTraffic_HXX