]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIPlane.hxx
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / ATC / AIPlane.hxx
index bb58f20cb4c36e564a3e347a49e8350a0c9478af..5815570eb25a6c1a502a058b2bbeab3d53fa08b7 100644 (file)
 // 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 <Model/model.hxx>
 #include <plib/sg.h>
 #include <plib/ssg.h>
 #include <simgear/math/point3d.hxx>
+#include <simgear/scene/model/model.hxx>
 
 #include "AIEntity.hxx"
-
+#include "ATC.hxx"
+
+enum PatternLeg {
+       TAKEOFF_ROLL,
+       CLIMBOUT,
+       TURN1,
+       CROSSWIND,
+       TURN2,
+       DOWNWIND,
+       TURN3,
+       BASE,
+       TURN4,
+       FINAL,
+       LANDING_ROLL,
+       LEG_UNKNOWN
+};
 
 /*****************************************************************
 *
@@ -50,16 +57,25 @@ class FGAIPlane : public FGAIEntity {
 
 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
@@ -80,7 +96,8 @@ protected:
 
     void Bank(double angle);
     void LevelWings(void);
-
+       
+       PatternLeg leg;
 };
 
 #endif  // _FG_AI_PLANE_HXX