]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/soundmgr_openal.cxx
the wrong name also mislead me: rotate velocity to the proper quat
[simgear.git] / simgear / sound / soundmgr_openal.cxx
index 4cf3a63c3bb3a4c7ed3e3e65a6c865e2d234d2b3..6066a560c32d1d22cc49679b387171fe0a8807d9 100644 (file)
@@ -133,11 +133,9 @@ void SGSoundMgr::init() {
     alDopplerFactor(1.0);
     alDopplerVelocity(340.3);   // speed of sound in meters per second.
 
-    if ( alIsExtensionPresent((const ALchar*)"EXT_exponent_distance") ) {
-        alDistanceModel(AL_EXPONENT_DISTANCE);
-    } else {
-        alDistanceModel(AL_INVERSE_DISTANCE);
-    }
+    // gain = AL_REFERENCE_DISTANCE / (AL_REFERENCE_DISTANCE +
+    //        AL_ROLLOFF_FACTOR * (distance - AL_REFERENCE_DISTANCE));
+    alDistanceModel(AL_INVERSE_DISTANCE_CLAMPED);
 
     testForALError("listener initialization");
 
@@ -263,7 +261,6 @@ if (isNaN(_at_up_vec)) printf("NaN in listener orientation\n");
 if (isNaN(toVec3f(_absolute_pos).data())) printf("NaN in listener position\n");
 if (isNaN(_velocity.data())) printf("NaN in listener velocity\n");
 #endif
-            update_pos_and_orientation();
             alListenerf( AL_GAIN, _volume );
             alListenerfv( AL_ORIENTATION, _at_up_vec );
             // alListenerfv( AL_POSITION, toVec3f(_absolute_pos).data() );
@@ -326,6 +323,7 @@ SGSampleGroup *SGSoundMgr::find( const string &refname, bool create ) {
         // sample group was not found.
         if (create) {
             SGSampleGroup* sgrp = new SGSampleGroup(this, refname);
+            add( sgrp, refname );
             return sgrp;
         }
         else