diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-08-06 20:06:16 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-08-06 20:06:16 -0700 |
commit | bcd84433717e42ec8675009e1335caf915cc1a41 (patch) | |
tree | 4151e4b1864d0ccf9a80f00fd6bfb1e88b1d0a44 | |
parent | 4277bfbba6696d47d9db5a3aa145891701c7d45f (diff) |
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.
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 7 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 19 |
3 files changed, 19 insertions, 8 deletions
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 0648d99685..9cc775d427 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -985,6 +985,13 @@ void LLPanelPrimMediaControls::onClickZoom() void LLPanelPrimMediaControls::nextZoomLevel() { + LLViewerObject* objectp = getTargetObject(); + if(objectp && objectp->isHUDAttachment()) + { + // Never allow zooming on HUD attachments. + return; + } + int index = 0; while (index < kNumZoomLevels) { diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 95c4f01e46..4d4a1e078d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1270,7 +1270,6 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) if (!parcel || objectp.isNull() || - objectp->isHUDAttachment() || pick.mObjectFace < 0 || pick.mObjectFace >= objectp->getNumTEs()) { 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) |