diff options
author | Chris Robinson <[email protected]> | 2011-07-05 03:36:14 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-07-05 03:36:14 -0700 |
commit | 83e322c5f3d638c478e1f969ea717a161a5dded3 (patch) | |
tree | 36d3b8ef09893725792c0c019d30e6a14da2e6b5 /Alc | |
parent | 6020b964c7c2007724fca07d25a21ac5115cb8cf (diff) |
Force front-centered for mono sounds that comes from the listener under HRTF
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -691,12 +691,19 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) Position[0] *= invlen; Position[1] *= invlen; Position[2] *= invlen; + GetLerpedHrtfCoeffs(asin(Position[1]), + atan2(Position[0], -Position[2]*ZScale), + DryGain, ALSource->Params.HrtfCoeffs[0], + ALSource->Params.HrtfDelay[0]); + } + else + { + /* Force front-centered for sounds that comes from the listener, + * to prevent +0 and -0 Z from producing inconsistent panning */ + GetLerpedHrtfCoeffs(0.0f, 0.0f, DryGain, + ALSource->Params.HrtfCoeffs[0], + ALSource->Params.HrtfDelay[0]); } - - GetLerpedHrtfCoeffs(asin(Position[1]), - atan2(Position[0], -Position[2]*ZScale), DryGain, - ALSource->Params.HrtfCoeffs[0], - ALSource->Params.HrtfDelay[0]); } else { |