float scale = 1;
if(frac < f->mid)
scale = f->taper+(1-f->taper) * (frac / f->mid);
- else
- scale = f->taper+(1-f->taper) * (frac - f->mid) / (1 - f->mid);
+ else {
+ if( isVersionOrNewer( YASIM_VERSION_32 ) ) {
+ // Correct calculation of width for fuselage taper.
+ scale = 1 - (1-f->taper) * (frac - f->mid) / (1 - f->mid);
+ } else {
+ // Original, incorrect calculation of width for fuselage taper.
+ scale = f->taper+(1-f->taper) * (frac - f->mid) / (1 - f->mid);
+ }
+ }
// Where are we?
float pos[3];
b[2] = attrf(a, "bz");
float taper = attrf(a, "taper", 1);
float mid = attrf(a, "midpoint", 0.5);
+ if (_airplane.isVersionOrNewer(Version::YASIM_VERSION_32)) {
+ // A fuselage's "midpoint" XML attribute is defined from the
+ // fuselage's front end, but the Fuselage object's internal
+ // "mid" attribute is actually defined from the rear end.
+ // Thus YASim's original interpretation of "midpoint" was wrong.
+ // Complement the "midpoint" value to ensure the fuselage
+ // points the right way.
+ mid = 1 - mid;
+ }
float cx = attrf(a, "cx", 1);
float cy = attrf(a, "cy", 1);
float cz = attrf(a, "cz", 1);