summaryrefslogtreecommitdiff
path: root/indra/newview/llworld.cpp
diff options
context:
space:
mode:
authorDebi King (Dessie) <dessie@lindenlab.com>2011-04-18 10:07:40 -0400
committerDebi King (Dessie) <dessie@lindenlab.com>2011-04-18 10:07:40 -0400
commitda7cd9f8117757cd6acb0a5e93bc3c60443374f9 (patch)
tree3916874ed180ee9567b4fb76d88d8ce72689c257 /indra/newview/llworld.cpp
parentd534c8009f2573400a21c19b00691536fc3cc23f (diff)
parentb8069d1c250c03e9fffda0a9264bfd04a12f8292 (diff)
merged from 2.6.4-start tag in viewer-development
Diffstat (limited to 'indra/newview/llworld.cpp')
-rw-r--r--indra/newview/llworld.cpp79
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);
}
}