summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-07 12:43:55 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-07 12:43:55 +0100
commit22f65ad046271d5f2ac0de19502dcd13bf8c4041 (patch)
treec3921e7ae800255c1adab9665548b313a19fb14c /indra/newview/llviewermedia.cpp
parent52138b24c509667c217b91ee17972b74e797bf4a (diff)
parentbcd84433717e42ec8675009e1335caf915cc1a41 (diff)
merge from viewer-release
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 77f7740449..1f3785d733 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -3079,20 +3079,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)