Skip to content

Commit

Permalink
Panning was totally hosed. Now it's a little less broken, I think.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 17, 2005
1 parent f6c6272 commit 66f1752
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions osx/alSoftware.c
Expand Up @@ -393,11 +393,16 @@ ALvoid __alRecalcMonoSource(ALcontext *ctx, ALsource *src)
if (!EPSILON_EQUAL(Distance, 0.0f))
{
register ALfloat Panning;
Panning = 2.0f * ( (0.5f + (0.5f * 0.707f)) *
cosf(atan2f(Position[2],Position[0])) );
// this is broken, pushes everything to the right.
//Panning = 2.0f * ( (0.5f + (0.5f * 0.707f)) *
// cosf(atan2f(Position[2],Position[0])) );

// not perfect, but fast and functional.
Panning = 0.5f + (0.5f*Position[0]);
CLAMP(Panning, -1.0f, 1.0f);

src->channelGain0 = CalcVolume * Panning * ctx->device->speakergains[0];
src->channelGain1 = CalcVolume * (2.0f - Panning) * ctx->device->speakergains[1];
src->channelGain1 = CalcVolume * (1.0f - Panning) * ctx->device->speakergains[1];
} // if
else
{
Expand Down

0 comments on commit 66f1752

Please sign in to comment.