summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-05-12 15:43:56 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-05-12 15:43:56 +0300
commit3afa084e220c0e745a90734b0ea2f68730b746bc (patch)
treea29585f942c9365feed9548c145ff5716ab84514 /indra/newview/llviewermedia.cpp
parentfbaae0a2df3b68756c7d910438041887d018cd63 (diff)
parent1cee577ca0234eee7da243c85be8eb7524d691c7 (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 1f6687bd83..4db05e8a98 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1934,13 +1934,13 @@ void LLViewerMediaImpl::updateVolume()
}
else if (mProximityCamera > gSavedSettings.getF32("MediaRollOffMin"))
{
- // attenuated_volume = v / ( 1 + (roll_off_rate * (d - min))^2
+ // attenuated_volume = 1 / (roll_off_rate * (d - min))^2
// the +1 is there so that for distance 0 the volume stays the same
F64 adjusted_distance = mProximityCamera - gSavedSettings.getF32("MediaRollOffMin");
F64 attenuation = gSavedSettings.getF32("MediaRollOffRate") * adjusted_distance;
- attenuation = attenuation * attenuation;
+ attenuation = 1.0 / (attenuation * attenuation);
// the attenuation multiplier should never be more than one since that would increase volume
- volume = volume * llmin(1.0, 1 /(attenuation + 1));
+ volume = volume * llmin(1.0, attenuation);
}
}