diff options
| author | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-05-13 15:56:34 +0300 |
|---|---|---|
| committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-05-13 15:56:34 +0300 |
| commit | bef3172ed989da5aed11eb1d8e51c071386d843c (patch) | |
| tree | ba214e92afbf7fe241e9b2512a04ab62c0861f46 /indra/newview/llviewermedia.cpp | |
| parent | 059a71423019b6a38c41e2dae6d3e879aa893beb (diff) | |
| parent | 3040d68c2637084176bdae759a89e264b1a3e14e (diff) | |
merge
--HG--
branch : product-engine
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); } } |
