]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIBase.hxx
fix a segmentation fault situation that is exposed at least on IRIX (but not Linux).
[flightgear.git] / src / AIModel / AIBase.hxx
index 90c3a4b6d2bfdc2f6c506fd5c962741a20372326..89c7981528b7d49c0a6b173d5d79db615b092305 100644 (file)
@@ -1,4 +1,4 @@
-// FGAIBase - abstract base class for AI objects
+// FGAIBase.hxx - abstract base class for AI objects
 // Written by David Culp, started Nov 2003, based on
 // David Luff's FGAIEntity class.
 // - davidculp2@comcast.net
@@ -62,7 +62,9 @@ typedef struct {
    double buoyancy;           // acceleration in ft per sec2
    double wind_from_east;     // in feet per second
    double wind_from_north;    // in feet per second
-   bool wind;
+   double cd;                 // coefficient of drag
+   bool wind;                 // if true, model reacts to parent wind
+   double weight;             // in lbs
 } FGAIModelEntity;
 
 
@@ -91,8 +93,7 @@ public:
     void setLongitude( double longitude );
     void setBank( double bank );
 
-    void setID( int ID );
-    int  getID();
+    void* getID();
     void setDie( bool die );
     bool getDie();
 
@@ -139,7 +140,6 @@ protected:
     ssgBranch * model;     //The 3D model object
     SGModelPlacement aip;
     bool delete_me;
-    int id;
     bool invisible;
     bool no_roll;
     double life;
@@ -179,6 +179,11 @@ public:
     double _getY_shift() const;
     double _getRotation() const;
 
+    static const double rho;
+    static const double lbs_to_slugs;
+
+    int _getID() const;
+
     inline double _getRange() { return range; };
 
     static bool _isNight();
@@ -217,10 +222,9 @@ inline void FGAIBase::setLatitude ( double latitude ) {
 inline void FGAIBase::setDie( bool die ) { delete_me = die; }
 inline bool FGAIBase::getDie() { return delete_me; }
 
-inline void FGAIBase::setID( int ID ) { id = ID; }
-inline int  FGAIBase::getID() { return id; }
-
 inline FGAIBase::object_type FGAIBase::getType() { return _otype; }
 
+inline void* FGAIBase::getID() { return this; }
+
 #endif // _FG_AIBASE_HXX