History

Restore legacy attenuation behavior for system sounds and scripts that do not set position. JS detects when "position" was not set by the script. C++ explicitly sets .positionSet=false when not set (for system sounds). Local rendering uses a direct mix (no attenuation/HRTF) when not set.

Ken Cooke committed 7 years ago

Commit fa08e421 parent fdd86878 files · +58 −25Browse files

Showing the changes to libraries/script-engine/src/AudioScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

libraries/script-engine/src/AudioScriptingInterface.cpp+2−2
@@ -38,10 +38,10 @@ void AudioScriptingInterface::setLocalAudioInterface(AbstractAudioInterface* aud · 37 unmodified lines
3838 }
3939 }
4040
41−ScriptAudioInjector* AudioScriptingInterface::playSystemSound(SharedSoundPointer sound, const QVector3D& position) {
41+ScriptAudioInjector* AudioScriptingInterface::playSystemSound(SharedSoundPointer sound) {
4242 AudioInjectorOptions options;
43− options.position = glm::vec3(position.x(), position.y(), position.z());
4443 options.localOnly = true;
44+ options.positionSet = false; // system sound
4545 return playSound(sound, options);
4646 }
4747