-#ifdef ENABLE_AUDIO_SUPPORT
- // Right now we make a simplifying assumption that the primary
- // aircraft is the source of all sounds and that all sounds are
- // positioned relative to the current view position.
-
- static sgVec3 last_pos_offset;
-
- // get the location data for the primary FDM (now hardcoded to ac model)...
- SGLocation *acmodel_loc = NULL;
- acmodel_loc = (SGLocation *)globals->
- get_aircraft_model()->get3DModel()->getSGLocation();
-
- // set positional offset for sources
- sgdVec3 dsource_pos_offset;
- sgdSubVec3( dsource_pos_offset,
- view_location->get_absolute_view_pos(),
- acmodel_loc->get_absolute_view_pos() );
- // cout << "pos all = " << source_pos_offset[0] << " " << source_pos_offset[1] << " " << source_pos_offset[2] << endl;
- sgVec3 source_pos_offset;
- sgSetVec3(source_pos_offset, dsource_pos_offset);
- globals->get_soundmgr()->set_source_pos_all( source_pos_offset );
-
- // set the velocity
- sgVec3 source_vel;
- sgSubVec3( source_vel, source_pos_offset, last_pos_offset );
- sgScaleVec3( source_vel, delta_time_sec );
- sgCopyVec3( last_pos_offset, source_pos_offset );
- // cout << "vel = " << source_vel[0] << " " << source_vel[1] << " " << source_vel[2] << endl;
- globals->get_soundmgr()->set_source_vel_all( source_vel );
-
- // Right now we make a simplifying assumption that the listener is
- // always positioned at the origin.
- sgVec3 listener_pos;
- sgSetVec3( listener_pos, 0.0, 0.0, 0.0 );
- // cout << "listener = " << listener_pos[0] << " " << listener_pos[1] << " " << listener_pos[2] << endl;
- globals->get_soundmgr()->set_listener_pos( listener_pos );
-#endif
+ // run Nasal's settimer() loops right before the view manager
+ globals->get_event_mgr()->update(delta_time_sec);
+
+ // update the view angle as late as possible, but before sound calculations
+ globals->get_viewmgr()->update(delta_time_sec);
+
+ // Do any I/O channel work that might need to be done (must come after viewmgr)
+ globals->get_io()->update(real_delta_time_sec);