Просмотр исходного кода

Fixed positional audio to actually be positional.
Prior to this change, all positional audio was relative
to the listener. So no amount of moving around or
turning of the head was going to make the sound any
different.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7494 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

PSp..om 14 лет назад
Родитель
Сommit
945683f432
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java

+ 2 - 0
engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java

@@ -360,6 +360,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
                         alSource3f(id, AL_POSITION, 0,0,0);
                         alSource3f(id, AL_VELOCITY, 0,0,0);
                     }else{
+                        alSourcei(id, AL_SOURCE_RELATIVE, AL_FALSE);
                         updateSourceParam(src, AudioParam.Position);
                         updateSourceParam(src, AudioParam.Velocity);
                         updateSourceParam(src, AudioParam.MaxDistance);
@@ -438,6 +439,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
             alSource3f(id, AL_VELOCITY, vel.x, vel.y, vel.z);
             alSourcef(id, AL_MAX_DISTANCE, src.getMaxDistance());
             alSourcef(id, AL_REFERENCE_DISTANCE, src.getRefDistance());
+            alSourcei(id, AL_SOURCE_RELATIVE, AL_FALSE);
 
             if (src.isReverbEnabled()){
                 int filter = EFX10.AL_FILTER_NULL;