diff options
author | Oz Linden <oz@lindenlab.com> | 2011-04-10 22:40:13 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-04-10 22:40:13 -0400 |
commit | ee9eef505279bf3983ec5fe4ce64ba3c38f0a76a (patch) | |
tree | 73ffbc468a65c2d4ed4c0dede4e24ad9e7cd69fd /indra/newview/llworld.cpp | |
parent | a248ed2a2ccb89c9716f8657ef3c52269518c909 (diff) | |
parent | 60bceb759b592348b403689ffa8ed9c768126f8b (diff) |
merge changes for storm-1057
Diffstat (limited to 'indra/newview/llworld.cpp')
-rw-r--r-- | indra/newview/llworld.cpp | 79 |
1 files changed, 32 insertions, 47 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 8f7197c607..6b2af1f8b7 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -98,11 +98,6 @@ LLWorld::LLWorld() : mEdgeWaterObjects[i] = NULL; } - if (gNoRender) - { - return; - } - LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,4); U8 *default_texture = raw->getData(); *(default_texture++) = MAX_WATER_COLOR.mV[0]; @@ -626,10 +621,7 @@ void LLWorld::updateVisibilities() if (LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) { regionp->calculateCameraDistance(); - if (!gNoRender) - { - regionp->getLand().updatePatchVisibilities(gAgent); - } + regionp->getLand().updatePatchVisibilities(gAgent); } else { @@ -1454,59 +1446,52 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi { positions->clear(); } - for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); - iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + // get the list of avatars from the character list first, so distances are correct + // when agent is above 1020m and other avatars are nearby + for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); + iter != LLCharacter::sInstances.end(); ++iter) { - LLViewerRegion* regionp = *iter; - const LLVector3d& origin_global = regionp->getOriginGlobal(); - S32 count = regionp->mMapAvatars.count(); - for (S32 i = 0; i < count; i++) + LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter; + if(!pVOAvatar->isDead() && !pVOAvatar->isSelf()) { - LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global); - if(dist_vec(pos_global, relative_to) <= radius) + LLUUID uuid = pVOAvatar->getID(); + if(!uuid.isNull()) { - if(positions != NULL) + LLVector3d pos_global = pVOAvatar->getPositionGlobal(); + if(dist_vec(pos_global, relative_to) <= radius) { - positions->push_back(pos_global); - } - if(avatar_ids != NULL) - { - avatar_ids->push_back(regionp->mMapAvatarIDs.get(i)); + if(positions != NULL) + { + positions->push_back(pos_global); + } + if(avatar_ids !=NULL) + { + avatar_ids->push_back(uuid); + } } } } } - // retrieve the list of close avatars from viewer objects as well - // for when we are above 1000m, only do this when we are retrieving - // uuid's too as there could be duplicates - if(avatar_ids != NULL) + // region avatars added for situations where radius is greater than RenderFarClip + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { - for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) + LLViewerRegion* regionp = *iter; + const LLVector3d& origin_global = regionp->getOriginGlobal(); + S32 count = regionp->mMapAvatars.count(); + for (S32 i = 0; i < count; i++) { - LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter; - if(pVOAvatar->isDead() || pVOAvatar->isSelf()) - continue; - LLUUID uuid = pVOAvatar->getID(); - if(uuid.isNull()) - continue; - LLVector3d pos_global = pVOAvatar->getPositionGlobal(); + LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global); if(dist_vec(pos_global, relative_to) <= radius) { - bool found = false; - uuid_vec_t::iterator sel_iter = avatar_ids->begin(); - for (; sel_iter != avatar_ids->end(); sel_iter++) - { - if(*sel_iter == uuid) - { - found = true; - break; - } - } - if(!found) + LLUUID uuid = regionp->mMapAvatarIDs.get(i); + // if this avatar doesn't already exist in the list, add it + if(uuid.notNull() && avatar_ids!=NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end()) { if(positions != NULL) + { positions->push_back(pos_global); + } avatar_ids->push_back(uuid); } } |