The error in the speed of the propellor, and other things that we might not have 
noticed yet, is caused by the handling of the variable "multi_loop" in 
main.cxx:fgUpdateTimeDepCalcs().  After being used to update the FDM, this 
"multi_loop" value (or the value 1 in freeze mode) is passed to the various subsystem 
"update" methods:

    globals->get_model_mgr()->update(multi_loop);
    globals->get_aircraft_model()->update(multi_loop);
    globals->get_viewmgr()->update(multi_loop);
    current_radiostack->update(multi_loop);

The model manager, at least, is expecting to receive the number of milliseconds that 
have elapsed since the last call.  The "multi_loop" number does not seem to be that.  
Nor does the definition of FGSubsystem::update help:
  /**
   * Update the subsystem.
   *
   * <p>FlightGear invokes this method every time the subsystem should
   * update its state.  If the subsystem requires delta time information,
   * it should track it itself.</p>
   */
  virtual void update (int dt) = 0;

That looks wrong to me.  Surely "it should track it itself" applied before the "dt" 
parameter existed, and now the "dt" parameter is intended to provide the time 
difference and should be defined here.

Anyone prepared to sort this out?  If "dt" is to represent milliseconds, it would be a 
good idea to rename it "dt_ms" (in the derived classes too).  I haven't checked how 
other classes interpret it.

- Julian

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to