diff options
author | Chris Robinson <[email protected]> | 2011-04-22 22:59:58 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-04-22 22:59:58 -0700 |
commit | 1e8718fe8787be8c17403b3e19fbf23916ff7193 (patch) | |
tree | 2f5e41f4265a214c4497a446e9704f096fce9464 /Alc | |
parent | 678d0b87d0be1aa84a07dff82652f2867d046921 (diff) |
Convert full-width cone angle source properties to half-width
The spec intends the property values to be the full angle encompassed by the
cones, but the calculation interprets them as the angle from the center
point.
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -357,8 +357,8 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) MinDist = ALSource->flRefDistance; MaxDist = ALSource->flMaxDistance; Rolloff = ALSource->flRollOffFactor; - InnerAngle = ALSource->flInnerAngle; - OuterAngle = ALSource->flOuterAngle; + InnerAngle = ALSource->flInnerAngle * 0.5f; + OuterAngle = ALSource->flOuterAngle * 0.5f; OuterGainHF = ALSource->OuterGainHF; AirAbsorptionFactor = ALSource->AirAbsorptionFactor; @@ -501,7 +501,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) } //3. Apply directional soundcones - Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * 180.0f/M_PI; + Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * 180.0/M_PI; if(Angle >= InnerAngle && Angle <= OuterAngle) { ALfloat scale = (Angle-InnerAngle) / (OuterAngle-InnerAngle); |