diff options
author | Chris Robinson <[email protected]> | 2017-02-23 16:44:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-23 16:44:59 -0800 |
commit | c2a79f0f7b1d8f9a868e3411797005cefcebafa1 (patch) | |
tree | 3d133c8c88bfd1f87375b22afe3b2abee83e4ede /OpenAL32 | |
parent | 08948079e93cbb7321be5715df36f54c5e6be3b7 (diff) |
Remove CalcXYZCoeffs and inline CalcAngleCoeffs
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alu.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 402c3181..326cde62 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -276,25 +276,21 @@ void aluInitEffectPanning(struct ALeffectslot *slot); void CalcDirectionCoeffs(const ALfloat dir[3], ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS]); /** - * CalcXYZCoeffs - * - * Same as CalcDirectionCoeffs except the direction is specified as separate x, - * y, and z parameters instead of an array. - */ -inline void CalcXYZCoeffs(ALfloat x, ALfloat y, ALfloat z, ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS]) -{ - ALfloat dir[3] = { x, y, z }; - CalcDirectionCoeffs(dir, spread, coeffs); -} - -/** * CalcAngleCoeffs * * Calculates ambisonic coefficients based on azimuth and elevation. The * azimuth and elevation parameters are in radians, going right and up * respectively. */ -void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS]); +inline void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS]) +{ + ALfloat dir[3] = { + sinf(azimuth) * cosf(elevation), + sinf(elevation), + -cosf(azimuth) * cosf(elevation) + }; + CalcDirectionCoeffs(dir, spread, coeffs); +} /** * CalcAnglePairwiseCoeffs |