diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 2 | ||||
-rw-r--r-- | Alc/hrtf.c | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -669,7 +669,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) { const ALshort *hrtf_left, *hrtf_right; - GetHrtfCoeffs(atan2(Position[1], -Position[2]*ZScale) * (180.0/M_PI), + GetHrtfCoeffs(asin(Position[1]) * (180.0/M_PI), atan2(Position[0], -Position[2]*ZScale) * (180.0/M_PI), &hrtf_left, &hrtf_right); for(i = 0;i < HRTF_LENGTH;i++) @@ -53,14 +53,14 @@ static void get_angle_coeffs(const HrtfFilterCoeffs *elev, ALfloat angle, const } } -void GetHrtfCoeffs(ALfloat azimuth, ALfloat angle, const ALshort **left, const ALshort **right) +void GetHrtfCoeffs(ALfloat elevation, ALfloat angle, const ALshort **left, const ALshort **right) { int idx; - if(azimuth > 90.f) azimuth = 90.f - (azimuth - 90.f); - else if(azimuth < -90.f) azimuth = -90.f - (azimuth - -90.f); + if(elevation > 90.f) elevation = 90.f - (elevation - 90.f); + else if(elevation < -90.f) elevation = -90.f - (elevation - -90.f); - idx = (int)(azimuth/10.0 + 0.5); + idx = (int)(elevation/10.0 + 0.5); if(idx >= 9) return get_angle_coeffs(&Elev90, angle, left, right); if(idx >= 8) return get_angle_coeffs(&Elev80, angle, left, right); if(idx >= 7) return get_angle_coeffs(&Elev70, angle, left, right); |