// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-/*****************************************************************
-*
-* WARNING - Curt has some ideas about AI traffic so anything in here
-* may get rewritten or scrapped. Contact Curt curt@flightgear.org
-* before spending any time or effort on this code!!!
-*
-******************************************************************/
-
#ifndef _FG_AI_PLANE_HXX
#define _FG_AI_PLANE_HXX
#include <simgear/math/point3d.hxx>
#include "AIEntity.hxx"
-
+#include "ATC.hxx"
+
+enum PatternLeg {
+ TAKEOFF_ROLL,
+ CLIMBOUT,
+ TURN1,
+ CROSSWIND,
+ TURN2,
+ DOWNWIND,
+ TURN3,
+ BASE,
+ TURN4,
+ FINAL,
+ LANDING_ROLL,
+ LEG_UNKNOWN
+};
/*****************************************************************
*
public:
+ FGAIPlane();
virtual ~FGAIPlane();
// Run the internal calculations
virtual void Update(double dt);
+
+ // Send a transmission *TO* the AIPlane.
+ // FIXME int code is a hack - eventually this will receive Alexander's coded messages.
+ virtual void RegisterTransmission(int code);
+
+ // Return the current pattern leg the plane is flying.
+ inline PatternLeg GetLeg() {return leg;}
protected:
+ PlaneRec plane;
double mag_hdg; // degrees - the heading that the physical aircraft is *pointing*
double track; // track that the physical aircraft is *following* - degrees relative to *true* north
- double yaw;
+ double crab; // Difference between heading and track due to wind.
double mag_var; // degrees
double IAS; // Indicated airspeed in knots
double vel; // velocity along track in knots
void Bank(double angle);
void LevelWings(void);
-
+
+ PatternLeg leg;
};
#endif // _FG_AI_PLANE_HXX