diff options
author | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-04-07 09:43:14 +0300 |
---|---|---|
committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-04-07 09:43:14 +0300 |
commit | e8e1e87dd5c4f13a041c8d04311399a59447899d (patch) | |
tree | 4dc67baeae6ac828654f9d391de63c434a3af41b /indra/newview/llviewermedia.cpp | |
parent | 3da3ed2ccb9bab68be113bf7a79e6f95f7b73f9e (diff) | |
parent | 3585792e73fcccb391329bb19cf00c049adc15f6 (diff) |
merge
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 8 |
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. } |