X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FYASim%2FFGFDM.hpp;h=0d5b43e379e9feee6a1291c4ee9d090bf910dce0;hb=d66903e9ad63b91182ccc25d9bb82f18f8dd98b6;hp=f67afe9f4d6f2b90cf23b20dc86fbedea5e6fdc8;hpb=f324ea9badf80a181fb4cf53b189dfb47c353079;p=flightgear.git diff --git a/src/FDM/YASim/FGFDM.hpp b/src/FDM/YASim/FGFDM.hpp index f67afe9f4..0d5b43e37 100644 --- a/src/FDM/YASim/FGFDM.hpp +++ b/src/FDM/YASim/FGFDM.hpp @@ -2,7 +2,7 @@ #define _FGFDM_HPP #include -#include +#include #include "Airplane.hpp" #include "Vector.hpp" @@ -27,6 +27,8 @@ public: // 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; Thruster* eng; }; @@ -34,23 +36,33 @@ private: struct PropOut { SGPropertyNode* prop; int handle, type; bool left; float min, max; }; - 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; @@ -64,6 +76,9 @@ private: // Output properties for the ControlMap Vector _controlProps; + // Radius of the vehicle, for intersection testing. + float _vehicle_radius; + // Parsing temporaries void* _currObj; bool _cruiseCurr;