]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/FGFDM.hpp
Merge branch 'durk/atcdcl-cond'
[flightgear.git] / src / FDM / YASim / FGFDM.hpp
index 3efec50d46dc32ddf8e107874c0dea9e0680ed36..0d5b43e379e9feee6a1291c4ee9d090bf910dce0 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef _FGFDM_HPP
 #define _FGFDM_HPP
 
-#include <simgear/easyxml.hxx>
+#include <simgear/xml/easyxml.hxx>
+#include <simgear/props/props.hxx>
 
 #include "Airplane.hpp"
 #include "Vector.hpp"
@@ -19,35 +20,49 @@ public:
     ~FGFDM();
     void init();
     void iterate(float dt);
+    void getExternalInput(float dt=1e6);
 
     Airplane* getAirplane();
 
     // XML parsing callback from XMLVisitor
     virtual void startElement(const char* name, const XMLAttributes &atts);
 
+    float getVehicleRadius(void) const { return _vehicle_radius; }
+
 private:
     struct AxisRec { char* name; int handle; };
-    struct EngRec { char* prefix; void* eng; };
+    struct EngRec { char* prefix; Thruster* eng; };
     struct WeightRec { char* prop; float size; int handle; };
+    struct PropOut { SGPropertyNode* prop; int handle, type; bool left;
+                     float min, max; };
 
-    void getExternalInput(float dt);
-    void setOutputProperties();
+    void setOutputProperties(float dt);
 
+    Rotor* parseRotor(XMLAttributes* a, const char* name);
     Wing* parseWing(XMLAttributes* a, const char* name);
     int parseAxis(const char* name);
     int parseOutput(const char* name);
     void parseWeight(XMLAttributes* a);
+    void parseTurbineEngine(XMLAttributes* a);
+    void parsePistonEngine(XMLAttributes* a);
     void parsePropeller(XMLAttributes* a);
     bool eq(const char* a, const char* b);
+    bool caseeq(const char* a, const char* b);
     char* dup(const char* s);
-    int attri(XMLAttributes* atts, char* attr);
-    int attri(XMLAttributes* atts, char* attr, int def); 
-    float attrf(XMLAttributes* atts, char* attr);
-    float attrf(XMLAttributes* atts, char* attr, float def); 
+    int attri(XMLAttributes* atts, const char* attr);
+    int attri(XMLAttributes* atts, const char* attr, int def); 
+    float attrf(XMLAttributes* atts, const char* attr);
+    float attrf(XMLAttributes* atts, const char* attr, float def); 
+    double attrd(XMLAttributes* atts, const char* attr);
+    double attrd(XMLAttributes* atts, const char* attr, double def); 
+    bool attrb(XMLAttributes* atts, const char* attr);
 
     // The core Airplane object we manage.
     Airplane _airplane;
 
+    // Aerodynamic turbulence model
+    Turbulence* _turb;
+
     // The list of "axes" that we expect to find as input.  These are
     // typically property names.
     Vector _axes;
@@ -56,8 +71,13 @@ private:
     Vector _weights;
 
     // Engine types.  Contains an EngRec structure.
-    Vector _jets;
-    Vector _pistons;
+    Vector _thrusters;
+
+    // Output properties for the ControlMap
+    Vector _controlProps;
+
+    // Radius of the vehicle, for intersection testing.
+    float _vehicle_radius;
 
     // Parsing temporaries
     void* _currObj;