summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-11-13 11:41:29 -0700
committerXiaohong Bao <bao@lindenlab.com>2013-11-13 11:41:29 -0700
commit754a671c93f55c3e1cde6cd2ee0771156f7abaf5 (patch)
tree357fb2d93798f01870654756623eec1dd42949f5 /indra/newview/llviewerregion.cpp
parent0eba8e8f23ecbdbfcb9a409dd91a1e2a6c4d3f00 (diff)
parent58b153cf878370643bd61914538a80e6512c7e5c (diff)
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-xindra/newview/llviewerregion.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index ae876c9f2e..f58eeb7e0b 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -956,6 +956,7 @@ void LLViewerRegion::removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* d
else //insert to vo cache tree.
{
entry->updateParentBoundingInfo();
+ entry->saveBoundingSphere();
addToVOCacheTree(entry);
}
@@ -1125,6 +1126,8 @@ void LLViewerRegion::updateVisibleEntries(F32 max_time)
//
//object projected area threshold
F32 projection_threshold = LLVOCacheEntry::getSquaredPixelThreshold(mImpl->mVOCachePartition->isFrontCull());
+ F32 dist_threshold = mImpl->mVOCachePartition->isFrontCull() ? gAgentCamera.mDrawDistance : LLVOCacheEntry::sRearFarRadius;
+
std::set< LLPointer<LLViewerOctreeGroup> >::iterator group_iter = mImpl->mVisibleGroups.begin();
for(; group_iter != mImpl->mVisibleGroups.end(); ++group_iter)
{
@@ -1147,7 +1150,7 @@ void LLViewerRegion::updateVisibleEntries(F32 max_time)
continue;
}
- vo_entry->calcSceneContribution(local_origin, needs_update, last_update);
+ vo_entry->calcSceneContribution(local_origin, needs_update, last_update, dist_threshold);
if(vo_entry->getSceneContribution() > projection_threshold)
{
mImpl->mWaitingList.insert(vo_entry);
@@ -1384,9 +1387,10 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time)
LLTimer update_timer;
LLVector4a camera_origin;
camera_origin.load3(LLViewerCamera::getInstance()->getOrigin().mV);
- F32 squared_back_threshold = LLVOCacheEntry::sRearFarRadius;
- squared_back_threshold *= squared_back_threshold;
-
+ LLVector4a local_origin;
+ local_origin.load3((LLViewerCamera::getInstance()->getOrigin() - getOriginAgent()).mV);
+ F32 back_threshold = LLVOCacheEntry::sRearFarRadius;
+
bool unstable = sNewObjectCreationThrottle < 0;
size_t max_update = unstable ? mImpl->mActiveSet.size() : 64;
if(!mInvisibilityCheckHistory && isViewerCameraStatic())
@@ -1405,8 +1409,12 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time)
{
iter = mImpl->mActiveSet.begin();
}
+ if((*iter)->getParentID() > 0)
+ {
+ continue; //skip child objects, they are removed with their parent.
+ }
- if(!(*iter)->isAnyVisible(camera_origin, squared_back_threshold) && (unstable || (*iter)->mLastCameraUpdated < sLastCameraUpdated))
+ if(!(*iter)->isAnyVisible(camera_origin, local_origin, back_threshold) && (unstable || (*iter)->mLastCameraUpdated < sLastCameraUpdated))
{
killObject((*iter), delete_list);
}