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
3.0
PSp..om 14 years ago
parent 3678d4d4a3
commit 945683f432
  1. 2
      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;

Loading…
Cancel
Save