aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-04-22 22:59:58 -0700
committerChris Robinson <[email protected]>2011-04-22 22:59:58 -0700
commit1e8718fe8787be8c17403b3e19fbf23916ff7193 (patch)
tree2f5e41f4265a214c4497a446e9704f096fce9464 /Alc/ALu.c
parent678d0b87d0be1aa84a07dff82652f2867d046921 (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/ALu.c')
-rw-r--r--Alc/ALu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 8c4dba3c..ea5a0319 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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);