diff options
author | Chris Robinson <[email protected]> | 2023-09-14 07:31:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-09-14 07:31:25 -0700 |
commit | f098f253324d4d9b0669e061fab006295d826a53 (patch) | |
tree | 6dada40a46c7b774be224eacaebd6ac64cec1b5c /core/mixer.h | |
parent | 2ea092d6ad43c636713f53532d7e68bd5444b91d (diff) |
Store channel positions as vectors instead of angles
To avoid extraneous conversions between angles and vectors
Diffstat (limited to 'core/mixer.h')
-rw-r--r-- | core/mixer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/mixer.h b/core/mixer.h index aa7597bb..a9c1f931 100644 --- a/core/mixer.h +++ b/core/mixer.h @@ -58,7 +58,7 @@ std::array<float,MaxAmbiChannels> CalcAmbiCoeffs(const float y, const float z, c * vector must be normalized (unit length), and the spread is the angular width * of the sound (0...tau). */ -inline std::array<float,MaxAmbiChannels> CalcDirectionCoeffs(const float (&dir)[3], +inline std::array<float,MaxAmbiChannels> CalcDirectionCoeffs(const al::span<const float,3> dir, const float spread) { /* Convert from OpenAL coords to Ambisonics. */ @@ -71,7 +71,7 @@ inline std::array<float,MaxAmbiChannels> CalcDirectionCoeffs(const float (&dir)[ * Calculates ambisonic coefficients based on an OpenAL direction vector. The * vector must be normalized (unit length). */ -constexpr std::array<float,MaxAmbiChannels> CalcDirectionCoeffs(const float (&dir)[3]) +constexpr std::array<float,MaxAmbiChannels> CalcDirectionCoeffs(const al::span<const float,3> dir) { /* Convert from OpenAL coords to Ambisonics. */ return CalcAmbiCoeffs(-dir[0], dir[1], -dir[2]); |