diff options
author | Chris Robinson <[email protected]> | 2020-02-08 22:39:32 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-02-08 22:39:32 -0800 |
commit | f2bc24f76152837904fc5ff72f032c234302d584 (patch) | |
tree | 84fb03e6dae911fa48272166d6f782186ed2d5bf | |
parent | 85395b23a4861da370565051d49617c81d617b1e (diff) |
Consistently use distant wavefronts for 0 distance
-rw-r--r-- | alc/alu.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index 27075477..00d6dade 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1138,13 +1138,10 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo { if(Device->AvgSpeakerDist > 0.0f) { - /* If the source distance is 0, set w0 to w1 to act as a pass- - * through. We still want to pass the signal through the - * filters so they keep an appropriate history, in case the - * source moves away from the listener. + /* If the source distance is 0, simulate a plane-wave by using + * infinite distance, which results in a w0 of 0. */ - const ALfloat w0{SPEEDOFSOUNDMETRESPERSEC / (Device->AvgSpeakerDist * Frequency)}; - + constexpr float w0{0.0f}; for(ALuint c{0};c < num_channels;c++) voice->mChans[c].mDryParams.NFCtrlFilter.adjust(w0); |