]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Airplane.hpp
Added a <solve-weight> subtag of the approach/cruise parameters that can
[flightgear.git] / src / FDM / YASim / Airplane.hpp
index 4bed725ea169e77ed64889be5ee6c2ad3fb7343d..763e8d5ead84e82a81694713a191cc09b6ef2736 100644 (file)
@@ -48,14 +48,15 @@ public:
     int addWeight(float* pos, float size);
     void setWeight(int handle, float mass);
 
-    void setApproach(float speed, float altitude);
-    void setApproach(float speed, float altitude, float aoa); 
-    void setCruise(float speed, float altitude);
+    void setApproach(float speed, float altitude, float aoa, float fuel);
+    void setCruise(float speed, float altitude, float fuel);
 
     void setElevatorControl(int control);
     void addApproachControl(int control, float val);
     void addCruiseControl(int control, float val);
 
+    void addSolutionWeight(bool approach, int idx, float wgt);
+
     int numGear();
     Gear* getGear(int g);
 
@@ -87,12 +88,14 @@ private:
                       int handle; float cg[3]; float mass; };
     struct Control { int control; float val; };
     struct WeightRec { int handle; Surface* surf; };
+    struct SolveWeight { bool approach; int idx; float wgt; };
 
     void runCruise();
     void runApproach();
     void setupState(float aoa, float speed, State* s);
     void solveGear();
     void solve();
+    void solveHelicopter();
     float compileWing(Wing* w);
     float compileRotor(Rotor* w);
     float compileFuselage(Fuselage* f);
@@ -104,6 +107,7 @@ private:
     void compileContactPoints();
     float normFactor(float f);
     void updateGearState();
+    void setupWeights(bool isApproach);
 
     Model _model;
     ControlMap _controls;
@@ -127,12 +131,15 @@ private:
 
     Vector _rotors;
 
+    Vector _solveWeights;
+
     Vector _cruiseControls;
     State _cruiseState;
     float _cruiseP;
     float _cruiseT;
     float _cruiseSpeed;
     float _cruiseWeight;
+    float _cruiseFuel;
 
     Vector _approachControls;
     State _approachState;
@@ -141,6 +148,7 @@ private:
     float _approachSpeed;
     float _approachAoA;
     float _approachWeight;
+    float _approachFuel;
 
     int _solutionIterations;
     float _dragFactor;