From 91258cc19221e08bac88b42fc2d60dbbf35997dc Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 7 Nov 2015 06:15:29 -0800 Subject: Simplify reverb panning rotations --- Alc/effects/reverb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 87c1e8cf..e1013309 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -1088,8 +1088,8 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection * instead of * -135 -> 0 -> +135 */ float offset, naz, nev; - naz = EarlyPanAngles[i] + (modff(((az-EarlyPanAngles[i])*length + F_PI + F_TAU)/F_TAU, &offset)*F_TAU) - F_PI; - nev = (modff(((ev )*length + F_PI + F_TAU)/F_TAU, &offset)*F_TAU) - F_PI; + naz = EarlyPanAngles[i] + (modff((az-EarlyPanAngles[i])*length/F_TAU + 1.5f, &offset)-0.5f)*F_TAU; + nev = (modff((ev )*length/F_TAU + 1.5f, &offset)-0.5f)*F_TAU; ComputeAngleGains(Device, naz, nev, Gain, State->Early.PanGain[i]); } } @@ -1109,8 +1109,8 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection for(i = 0;i < 4;i++) { float offset, naz, nev; - naz = LatePanAngles[i] + (modff(((az-LatePanAngles[i])*length + F_PI + F_TAU)/F_TAU, &offset)*F_TAU) - F_PI; - nev = (modff(((ev )*length + F_PI + F_TAU)/F_TAU, &offset)*F_TAU) - F_PI; + naz = LatePanAngles[i] + (modff((az-LatePanAngles[i])*length/F_TAU + 1.5f, &offset)-0.5f)*F_TAU; + nev = (modff((ev )*length/F_TAU + 1.5f, &offset)-0.5f)*F_TAU; ComputeAngleGains(Device, naz, nev, Gain, State->Late.PanGain[i]); } } -- cgit v1.2.3