]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Airplane.hpp
Port over remaining Point3D usage to the more type and unit safe SG* classes.
[flightgear.git] / src / FDM / YASim / Airplane.hpp
index ad8b2c13e1678c6574e3f9337bff75cdb91dd56b..913eb49edcc3126c379e4887164302eda52e5b4f 100644 (file)
@@ -13,6 +13,7 @@ class Gear;
 class Hook;
 class Launchbar;
 class Thruster;
+class Hitch;
 
 class Airplane {
 public:
@@ -37,19 +38,21 @@ public:
     void addVStab(Wing* vstab);
 
     void addFuselage(float* front, float* back, float width,
-                     float taper=1, float mid=0.5);
+                     float taper=1, float mid=0.5,
+                     float cx=1, float cy=1, float cz=1, float idrag=1);
     int addTank(float* pos, float cap, float fuelDensity);
     void addGear(Gear* g);
     void addHook(Hook* h);
     void addLaunchbar(Launchbar* l);
     void addThruster(Thruster* t, float mass, float* cg);
     void addBallast(float* pos, float mass);
+    void addHitch(Hitch* h);
 
     int addWeight(float* pos, float size);
     void setWeight(int handle, float mass);
 
-    void setApproach(float speed, float altitude, float aoa, float fuel);
-    void setCruise(float speed, float altitude, float fuel);
+    void setApproach(float speed, float altitude, float aoa, float fuel, float gla);
+    void setCruise(float speed, float altitude, float fuel, float gla);
 
     void setElevatorControl(int control);
     void addApproachControl(int control, float val);
@@ -60,6 +63,8 @@ public:
     int numGear();
     Gear* getGear(int g);
     Hook* getHook();
+    int numHitches() { return _hitches.size(); }
+    Hitch* getHitch(int h);
     Rotorgear* getRotorgear();
     Launchbar* getLaunchbar();
 
@@ -85,14 +90,14 @@ public:
     float getCruiseAoA();
     float getTailIncidence();
     float getApproachElevator() { return _approachElevator.val; }
-    char* getFailureMsg();
+    const char* getFailureMsg();
 
-    static void setupState(float aoa, float speed, State* s); // utility
+    static void setupState(float aoa, float speed, float gla, State* s); // utility
 
 private:
     struct Tank { float pos[3]; float cap; float fill;
                  float density; int handle; };
-    struct Fuselage { float front[3], back[3], width, taper, mid; };
+    struct Fuselage { float front[3], back[3], width, taper, mid, _cx, _cy, _cz, _idrag; };
     struct GearRec { Gear* gear; Surface* surf; float wgt; };
     struct ThrustRec { Thruster* thruster;
                       int handle; float cg[3]; float mass; };
@@ -107,7 +112,7 @@ private:
     void solve();
     void solveHelicopter();
     float compileWing(Wing* w);
-    float compileRotorgear();
+    void compileRotorgear();
     float compileFuselage(Fuselage* f);
     void compileGear(GearRec* gr);
     void applyDragFactor(float factor);
@@ -138,6 +143,7 @@ private:
     Vector _contacts; // non-gear ground contact points
     Vector _weights;
     Vector _surfs; // NON-wing Surfaces
+    Vector _hitches; //for airtow and winch
 
     Vector _solveWeights;
 
@@ -148,6 +154,7 @@ private:
     float _cruiseSpeed;
     float _cruiseWeight;
     float _cruiseFuel;
+    float _cruiseGlideAngle;
 
     Vector _approachControls;
     State _approachState;
@@ -157,6 +164,7 @@ private:
     float _approachAoA;
     float _approachWeight;
     float _approachFuel;
+    float _approachGlideAngle;
 
     int _solutionIterations;
     float _dragFactor;
@@ -164,7 +172,7 @@ private:
     float _cruiseAoA;
     float _tailIncidence;
     Control _approachElevator;
-    char* _failureMsg;
+    const char* _failureMsg;
 };
 
 }; // namespace yasim