mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-27 01:06:19 +00:00
Changed: Avoid some more sqrt calculations
This commit is contained in:
parent
1709e7ed8a
commit
1eae7bc35b
1 changed files with 4 additions and 3 deletions
|
@ -82,9 +82,9 @@ float ISource::computeManualRolloff(double alpha, float sqrdist, float distMin,
|
|||
}
|
||||
else
|
||||
{
|
||||
double dist = (double)sqrt(sqrdist);
|
||||
if (alpha < 0.0f)
|
||||
{
|
||||
double dist = (double)sqrt(sqrdist);
|
||||
// inverse distance rolloff
|
||||
float rolloff = distMin / dist;
|
||||
if (alpha <= -1.0f) return rolloff;
|
||||
|
@ -100,6 +100,7 @@ float ISource::computeManualRolloff(double alpha, float sqrdist, float distMin,
|
|||
// full attenuation
|
||||
return 0.0f;
|
||||
}
|
||||
double dist = (double)sqrt(sqrdist);
|
||||
if (alpha == 0.0f)
|
||||
{
|
||||
// linearly descending volume on a dB scale
|
||||
|
|
Loading…
Reference in a new issue