aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-07-05 03:36:14 -0700
committerChris Robinson <[email protected]>2011-07-05 03:36:14 -0700
commit83e322c5f3d638c478e1f969ea717a161a5dded3 (patch)
tree36d3b8ef09893725792c0c019d30e6a14da2e6b5
parent6020b964c7c2007724fca07d25a21ac5115cb8cf (diff)
Force front-centered for mono sounds that comes from the listener under HRTF
-rw-r--r--Alc/ALu.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index ed2c7b3e..d6129c10 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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
{