]> git.mxchange.org Git - flightgear.git/commitdiff
Fixed a problem with the sound hack ... code was using a value that was never
authorcurt <curt>
Fri, 11 Aug 2000 20:25:30 +0000 (20:25 +0000)
committercurt <curt>
Fri, 11 Aug 2000 20:25:30 +0000 (20:25 +0000)
initialized or updated ... switched to a different value that was both
initialized and updated ... :-)

src/Main/main.cxx
src/Main/views.cxx

index 57b2056eb5c0e2b2dbd39db356c5f01c7083d0a9..ec67ea5b65ac93a1b051cd3e4d55c17ae31fa079 100644 (file)
@@ -891,6 +891,8 @@ static void fgMainLoop( void ) {
 
 #   ifdef MICHAEL_JOHNSON_EXPERIMENTAL_ENGINE_AUDIO
 
+       static double kts_to_fts = NM_TO_METER * METER_TO_FEET / 3600.0;
+
        // note: all these factors are relative to the sample.  our
        // sample format should really contain a conversion factor so
        // that we can get prop speed right for arbitrary samples.
@@ -904,17 +906,17 @@ static void fgMainLoop( void ) {
        double pitch = log((controls.get_throttle(0) * 14.0) + 1.0);
        //fprintf(stderr, "pitch1: %f ", pitch);
        // if (controls.get_throttle(0) > 0.0 || 
-       //     cur_fdm_state->v_rel_wind > 40.0) {
+       //     cur_fdm_state->get_V_calibrated_kts() > 40.0) {
 
-       //fprintf(stderr, "rel_wind: %f ", cur_fdm_state->v_rel_wind);
+       //fprintf(stderr, "rel_wind: %f ", cur_fdm_state->get_V_calibrated_kts());
        // only add relative wind and AoA if prop is moving
        // or we're really flying at idle throttle
        if (pitch < 5.4) {  // this needs tuning
            // prop tips not breaking sound barrier
-           pitch += log(cur_fdm_state->v_rel_wind + 0.8)/2;
+           pitch += log(cur_fdm_state->get_V_calibrated_kts() * kts_to_fts + 0.8)/2;
        } else {
            // prop tips breaking sound barrier
-           pitch += log(cur_fdm_state->v_rel_wind + 0.8)/10;
+           pitch += log(cur_fdm_state->get_V_calibrated_kts() * kts_to_fts + 0.8)/10;
        }
        //fprintf(stderr, "pitch2: %f ", pitch);
        //fprintf(stderr, "AoA: %f ", FG_Gamma_vert_rad);
@@ -936,7 +938,7 @@ static void fgMainLoop( void ) {
        // fprintf(stderr, "pitch4: %f\n", pitch);
 
        double volume = controls.get_throttle(0) * 1.15 + 0.3 +
-           log(cur_fdm_state->v_rel_wind + 1.0)/14.0;
+           log(cur_fdm_state->get_V_calibrated_kts() * kts_to_fts + 1.0)/14.0;
        // fprintf(stderr, "volume: %f\n", volume);
 
        pitch_envelope.setStep  ( 0, 0.01, pitch );
index 918e28993487f301f455a780f06c89eb2ec5ef4a..92450c635916044fe6a555748a31c95e8f43a7bc 100644 (file)
@@ -387,7 +387,7 @@ void FGView::UpdateViewMath( const FGInterface& f ) {
 }
 
 
-void  FGView::CurrentNormalInLocalPlane(sgVec3 dst, sgVec3 src) {
+void FGView::CurrentNormalInLocalPlane(sgVec3 dst, sgVec3 src) {
     sgVec3 tmp;
     sgSetVec3(tmp, src[0], src[1], src[2] );
     sgMat4 TMP;