Skip to content
Snippets Groups Projects
Commit 8cd95bd1 authored by Xiaohong Bao's avatar Xiaohong Bao
Browse files

add some debug code for EXT-5394: Crash in LLViewerMediaImpl::calculateInterest()

parent 309d9445
No related branches found
No related tags found
No related merge requests found
...@@ -2875,7 +2875,13 @@ void LLViewerMediaImpl::calculateInterest() ...@@ -2875,7 +2875,13 @@ void LLViewerMediaImpl::calculateInterest()
if(!mObjectList.empty()) 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. // 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. mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same.
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment