From e98a52a211e7c5d0fad777e561e5a55fcd3e28cd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 20 May 2010 14:00:56 -0700 Subject: tweaked media attenuation to better match object sound attenuation --- indra/newview/llviewermedia.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermedia.cpp') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 4db05e8a98..1c1c86d3cd 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1937,7 +1937,7 @@ void LLViewerMediaImpl::updateVolume() // 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; + F64 attenuation = 1.f + (gSavedSettings.getF32("MediaRollOffRate") * adjusted_distance); attenuation = 1.0 / (attenuation * attenuation); // the attenuation multiplier should never be more than one since that would increase volume volume = volume * llmin(1.0, attenuation); -- cgit v1.2.3