diff options
author | Chris Robinson <[email protected]> | 2018-08-29 01:45:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-08-29 01:45:27 -0700 |
commit | 529f387695d10368aca3460baa428ee90eea8332 (patch) | |
tree | c0a09bf197df4811bc41371fb66d439fc43fdc08 /OpenAL32/Include | |
parent | dacd08dc5dc90369d7d38ff712475bd79fcb0023 (diff) |
Use a separate method to warp the azimuth for plain stereo output
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alu.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index c09caa65..ed318ada 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -477,14 +477,18 @@ inline void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, } /** - * CalcAnglePairwiseCoeffs + * ScaleAzimuthFront * - * Calculates ambisonic coefficients based on azimuth and elevation. The - * azimuth and elevation parameters are in radians, going right and up - * respectively. This pairwise variant warps the result such that +30 azimuth - * is full right, and -30 azimuth is full left. + * Scales the given azimuth toward the side (+/- pi/2 radians) for positions in + * front. */ -void CalcAnglePairwiseCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS]); +inline float ScaleAzimuthFront(float azimuth, float scale) +{ + ALfloat sign = (azimuth < 0.0f) ? -1.0f : 1.0f; + if(!(fabsf(azimuth) > F_PI_2)) + return minf(fabsf(azimuth) * scale, F_PI_2) * sign; + return azimuth; +} void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, ALsizei numcoeffs, const ALfloat coeffs[MAX_AMBI_COEFFS], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]); |