|
|
@ -89,10 +89,18 @@ float ISource::computeManualRolloff(double alpha, float sqrdist, float distMin,
|
|
|
|
float rolloff = distMin / dist;
|
|
|
|
float rolloff = distMin / dist;
|
|
|
|
if (alpha <= -1.0f) return rolloff;
|
|
|
|
if (alpha <= -1.0f) return rolloff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dist > distMax)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// full attenuation of mbrolloff
|
|
|
|
|
|
|
|
return (-alpha * rolloff);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
double mb = mbMin * (dist - distMin) / (distMax - distMin);
|
|
|
|
double mb = mbMin * (dist - distMin) / (distMax - distMin);
|
|
|
|
float mbrolloff = (float)pow(10.0, (double)mb / 2000.0);
|
|
|
|
float mbrolloff = (float)pow(10.0, (double)mb / 2000.0);
|
|
|
|
return ((1.0 + alpha) * mbrolloff - alpha * rolloff);
|
|
|
|
return ((1.0 + alpha) * mbrolloff - alpha * rolloff);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (sqrdist > distMax * distMax)
|
|
|
|
if (sqrdist > distMax * distMax)
|
|
|
|