From bcd84433717e42ec8675009e1335caf915cc1a41 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 6 Aug 2010 20:06:16 -0700 Subject: Fixes for EXT-8563 "VWR-20156: Prim Media on HUDs has no Audio or Interactivity" Backed out changeset 1b65d0d42c67 (the fix for EXT-5205), and replaced it with a check in LLPanelPrimMediaControls::nextZoomLevel(). Made LLViewerMediaImpl::calculateInterest() not attempt to calculate distances to HUD attachments, since their global positions are invalid. --- indra/newview/llviewermedia.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewermedia.cpp') 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) -- cgit v1.2.3