summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-04-02 10:40:48 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-04-02 10:40:48 -0600
commit36987904d4568b5398122b3e09bea305bc49edc6 (patch)
tree7a532f64820944f3f128d9e328f26d9e84ca4d24 /indra/newview/llviewermedia.cpp
parenta7085418df1ada6e19b94b6df772ed21e663d119 (diff)
parent8cd95bd12a238c99052cff9195b39467d22e1275 (diff)
Automated merge with ssh://hg.lindenlab.com/q/viewer-trunk
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index e0cbddafae..170eb7ae86 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2968,7 +2968,13 @@ void LLViewerMediaImpl::calculateInterest()
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.
- LLVector3d global_delta = gAgent.getPositionGlobal() - (*mObjectList.begin())->getPositionGlobal();
+ std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ;
+ LLVOVolume* objp = *iter ;
+ llassert_always(objp != NULL) ;
+
+ 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.
}