diff options
author | Chris Robinson <[email protected]> | 2015-02-09 21:43:38 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-02-10 05:38:16 -0800 |
commit | cf5856ed481009621882078727212e5da65e60ee (patch) | |
tree | 6142f7fb61c7381fc191aebc21f79cab5b93d08c /Alc | |
parent | a1d4847d078f4f807f5697f299eea834797f4287 (diff) |
Correct conversion from polar to cartesian coords for HRTF
A functional no-op (cos(a) == cos(-a), -sin(a) == sin(-a)), but Ambisonics
expects the azimuth angle to go counter-clockwise.
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/hrtf.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -359,9 +359,9 @@ void GetBFormatHrtfCoeffs(const struct Hrtf *Hrtf, const ALfloat ambi_coeffs[4], az = (ALfloat)azi_idx / (ALfloat)azcount * F_2PI; if(az > F_PI) az -= F_2PI; - x = cosf(az) * cosf(elev); - y = -sinf(az) * cosf(elev); - z = sinf(elev); + x = cosf(-az) * cosf(elev); + y = sinf(-az) * cosf(elev); + z = sinf(elev); gain = 0.0f; gain += ambi_coeffs[0]*0.7071f; /* sqrt(1.0 / 2.0) */ |