summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-08-09 16:15:59 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-08-09 16:15:59 +0300
commitfcc19791b3ffc1e65de77c20d7fa441bf3c4f1ad (patch)
tree0f56493307da5ef59cafbe19fca1a43c0bb17ed6 /indra/newview/llviewermedia.cpp
parentc187fdcf1fbac21cb7292d6269023eae83cb6847 (diff)
parentc70b05082f7175a43f0957fabcba1f0a2581471c (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 34e30b3ccd..44d9bb1373 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -3053,20 +3053,25 @@ void LLViewerMediaImpl::calculateInterest()
// Calculate distance from the avatar, for use in the proximity calculation.
mProximityDistance = 0.0f;
+ mProximityCamera = 0.0f;
if(!mObjectList.empty())
{
// Just use the first object in the list. We could go through the list and find the closest object, but this should work well enough.
std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ;
LLVOVolume* objp = *iter ;
llassert_always(objp != NULL) ;
+
+ // The distance calculation is invalid for HUD attachments -- leave both mProximityDistance and mProximityCamera at 0 for them.
+ if(!objp->isHUDAttachment())
+ {
+ LLVector3d obj_global = objp->getPositionGlobal() ;
+ LLVector3d agent_global = gAgent.getPositionGlobal() ;
+ LLVector3d global_delta = agent_global - obj_global ;
+ mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same.
- LLVector3d obj_global = objp->getPositionGlobal() ;
- LLVector3d agent_global = gAgent.getPositionGlobal() ;
- LLVector3d global_delta = agent_global - obj_global ;
- mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same.
-
- LLVector3d camera_delta = gAgentCamera.getCameraPositionGlobal() - obj_global;
- mProximityCamera = camera_delta.magVec();
+ LLVector3d camera_delta = gAgentCamera.getCameraPositionGlobal() - obj_global;
+ mProximityCamera = camera_delta.magVec();
+ }
}
if(mNeedsMuteCheck)