diff options
author | James Cook <james@lindenlab.com> | 2010-05-13 15:47:32 -0700 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-05-13 15:47:32 -0700 |
commit | 8b524549902b780c2833691368bc35bdb1837cd9 (patch) | |
tree | b742a7f5463fb42663fa51e1029c80671ceb881b /indra/newview/llviewermedia.cpp | |
parent | 14f423a23c38bf554e9633752074fbcabd92599c (diff) | |
parent | aebb49520b1919e0ac2bcc7373fc2db031e3b7f0 (diff) |
merge pull from dessie/viewer-public, picking up SLE code
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 6 |
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); } } |