diff --git a/src/FDM/YASim/FGFDM.cpp b/src/FDM/YASim/FGFDM.cpp index 40bf6efa2..d981eb516 100644 --- a/src/FDM/YASim/FGFDM.cpp +++ b/src/FDM/YASim/FGFDM.cpp @@ -832,7 +832,12 @@ Wing* FGFDM::parseWing(XMLAttributes* a, const char* type, Version * version) w->setSweep(attrf(a, "sweep", 0) * DEG2RAD); w->setTaper(attrf(a, "taper", 1)); w->setDihedral(attrf(a, "dihedral", defDihed) * DEG2RAD); - w->setCamber(attrf(a, "camber", 0)); + + float camber = attrf(a, "camber", 0); + if (!version->isVersionOrNewer(Version::YASIM_VERSION_2017_2) && (camber == 0)) { + SG_LOG(SG_FLIGHT, SG_DEV_WARN, "YASIM warning: versions before 2017.2 are buggy for wings with camber=0"); + } + w->setCamber(camber); // These come in with positive indicating positive AoA, but the // internals expect a rotation about the left-pointing Y axis, so diff --git a/src/FDM/YASim/RigidBody.cpp b/src/FDM/YASim/RigidBody.cpp index e1fb94b70..495098525 100644 --- a/src/FDM/YASim/RigidBody.cpp +++ b/src/FDM/YASim/RigidBody.cpp @@ -55,13 +55,12 @@ void RigidBody::setMass(int handle, float mass) void RigidBody::setMass(int handle, float mass, const float* pos, bool isStatic) { - _masses[handle].m = mass; _masses[handle].isStatic = isStatic; Math::set3(pos, _masses[handle].p); + setMass(handle, mass); if (_bodyN != 0) { SGPropertyNode_ptr n = _bodyN->getChild("mass", handle, true); n->getNode("isStatic", true)->setValue(isStatic); - n->getNode("mass", true)->setFloatValue(mass); n->getNode("pos-x", true)->setFloatValue(pos[0]); n->getNode("pos-y", true)->setFloatValue(pos[1]); n->getNode("pos-z", true)->setFloatValue(pos[2]); diff --git a/src/FDM/YASim/RigidBody.hpp b/src/FDM/YASim/RigidBody.hpp index d7ca39939..4b982e070 100644 --- a/src/FDM/YASim/RigidBody.hpp +++ b/src/FDM/YASim/RigidBody.hpp @@ -82,7 +82,7 @@ public: void setBodySpin(const float* rotation) { Math::set3(rotation, _spin); } // Returns the center of gravity of the masses, in the body - // coordinate system. + // coordinate system. valid only after recalc() void getCG(float* cgOut) { Math::set3(_cg, cgOut); } // Returns the acceleration of the body's c.g. relative to the diff --git a/src/FDM/YASim/yasim-test.cpp b/src/FDM/YASim/yasim-test.cpp index 71c4ac8ef..5b2b8e2f5 100644 --- a/src/FDM/YASim/yasim-test.cpp +++ b/src/FDM/YASim/yasim-test.cpp @@ -174,12 +174,15 @@ void yasim_drag(Airplane* a, const float aoa, const float alt, int cfg = CONFIG_ int usage() { - fprintf(stderr, "Usage: yasim [-g [-a alt] [-s kts] [-approach | -cruise] ]\n"); - fprintf(stderr, " yasim [-d [-a alt] [-approach | -cruise] ]\n"); - fprintf(stderr, " yasim [-m]\n"); - fprintf(stderr, " -g print lift/drag table: aoa, lift, drag, lift/drag \n"); - fprintf(stderr, " -d print drag over TAS: kts, drag\n"); - fprintf(stderr, " -m print mass distribution table: id, x, y, z, mass \n"); + fprintf(stderr, "Usage: \n"); + fprintf(stderr, " yasim [-g [-a meters] [-s kts] [-approach | -cruise] ]\n"); + fprintf(stderr, " yasim [-d [-a meters] [-approach | -cruise] ]\n"); + fprintf(stderr, " yasim [-m]\n"); + fprintf(stderr, " -g print lift/drag table: aoa, lift, drag, lift/drag \n"); + fprintf(stderr, " -d print drag over TAS: kts, drag\n"); + fprintf(stderr, " -a set altitude in meters!\n"); + fprintf(stderr, " -s set speed in knots\n"); + fprintf(stderr, " -m print mass distribution table: id, x, y, z, mass \n"); return 1; }