---------------------- revision 1.3 date: 2008/12/04 18:47:49; author: mfranz; state: Exp; lines: +1 -1 Allow negative thrust. This allows a single recoil or vibration thruster to accelerate in both directions. THROTTLE input still clamps to 0/1 by default. (OK'ed by Andy) ----------------------
This change breaks PistonEngine (via PropEngine). Line 156: _mp *= _minMP + (1 -_minMP) * _throttle; _mp is going to be negative. Line 172: float T = temp * Math::pow(_mp/pressure, 2.0/7.0); T is going to be, guess what, NaN! And that ends up in fuel flow, that goes into fuel level, that affects cg, that affects acceleration/speed/position and that affects everything else (not an exhaustive list). Was kind of tedious to track this down backwards ;) Anybody know a way to set a breakpoint that activates whenever an operation results in NaN? (Maybe should have asked that earlier, lol) We could work around this by first doing the square and then the 7th root, but I am not sure negative throttle makes any sense here, and could still cause trouble elsewhere. Probably a better solution would be to re-add the [0,1] clamp for the throttle specifically for PistonEngine (and any other engine that chokes on negative throttle). Arguably, a negative throttle setting shouldn't make it to yasim if the given configuration is known not to handle it, so one could say it is a bug elsewhere (in this case the nasal scripts for the hurricane). Also, this part gave me shivers: if(_omega == 0.0) _omega = 0.001; // hack to get around reports of NaNs somewhere... On a different note, when MP is enabled I see random corruption of the OSG database search path list. Happens infrequently (about 1 in 20), hard to reproduce it. -- I wish everybody a Happy New Year, Csaba/Jester ------------------------------------------------------------------------------ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel