1
0
Fork 0

Merge /u/jsb1685/flightgear/ branch yasim into next

https://sourceforge.net/p/flightgear/flightgear/merge-requests/84/
This commit is contained in:
James Turner 2017-03-29 15:49:16 +00:00
commit f6f2c3b89a
4 changed files with 17 additions and 10 deletions

View file

@ -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

View file

@ -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]);

View file

@ -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

View file

@ -174,11 +174,14 @@ void yasim_drag(Airplane* a, const float aoa, const float alt, int cfg = CONFIG_
int usage()
{
fprintf(stderr, "Usage: yasim <ac.xml> [-g [-a alt] [-s kts] [-approach | -cruise] ]\n");
fprintf(stderr, " yasim <ac.xml> [-d [-a alt] [-approach | -cruise] ]\n");
fprintf(stderr, " yasim <ac.xml> [-m]\n");
fprintf(stderr, "Usage: \n");
fprintf(stderr, " yasim <aircraft.xml> [-g [-a meters] [-s kts] [-approach | -cruise] ]\n");
fprintf(stderr, " yasim <aircraft.xml> [-d [-a meters] [-approach | -cruise] ]\n");
fprintf(stderr, " yasim <aircraft.xml> [-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;
}