diff options
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llvieweroctree.h | 1 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 10 | ||||
-rwxr-xr-x | indra/newview/llvocache.cpp | 2 |
4 files changed, 17 insertions, 3 deletions
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 993967ee94..ef802f2651 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -425,6 +425,13 @@ void LLViewerOctreeEntryData::setVisible() const } } +void LLViewerOctreeEntryData::resetVisible() const +{ + if(mEntry) + { + mEntry->mVisible = 0; + } +} //----------------------------------------------------------------------------------- //class LLViewerOctreeGroup definitions //----------------------------------------------------------------------------------- diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h index 6ea6130413..611f285c8e 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -156,6 +156,7 @@ public: U32 getVisible() const {return mEntry ? mEntry->mVisible : 0;} void setVisible() const; + void resetVisible() const; virtual bool isVisible() const; virtual bool isRecentlyVisible() const; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index e73b4fb62c..d619a2af8b 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1061,15 +1061,19 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time) LLTimer update_timer; + const F32 LARGE_SCENE_CONTRIBUTION = 100.f; //a large number to force to load the object. const LLVector3 camera_origin = LLViewerCamera::getInstance()->getOrigin(); const U32 cur_frame = LLViewerOctreeEntryData::getCurrentFrame(); bool needs_update = ((cur_frame - mImpl->mLastCameraUpdate) > 5) && ((camera_origin - mImpl->mLastCameraOrigin).lengthSquared() > 10.f); + U32 last_update = mImpl->mLastCameraUpdate; //process visible entries for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mVisibleEntries.begin(); iter != mImpl->mVisibleEntries.end();) { LLVOCacheEntry* vo_entry = *iter; - vo_entry->calcSceneContribution(camera_origin, needs_update, mImpl->mLastCameraUpdate); + + //set a large number to force to load this object. + vo_entry->setSceneContribution(LARGE_SCENE_CONTRIBUTION); if(vo_entry->getState() < LLVOCacheEntry::WAITING) { @@ -1084,7 +1088,7 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time) child = vo_entry->getChild(i); if(child->getState() < LLVOCacheEntry::WAITING) { - child->setSceneContribution(vo_entry->getSceneContribution()); + child->setSceneContribution(LARGE_SCENE_CONTRIBUTION); //a large number to force to load the child. mImpl->mWaitingList.insert(child); } else @@ -1140,7 +1144,7 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time) continue; } - vo_entry->calcSceneContribution(camera_origin, needs_update, mImpl->mLastCameraUpdate); + vo_entry->calcSceneContribution(camera_origin, needs_update, last_update); mImpl->mWaitingList.insert(vo_entry); } } diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 3f2a39ba2b..72270eec46 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -250,6 +250,7 @@ void LLVOCacheEntry::addChild(LLVOCacheEntry* entry) if(getEntry() != NULL && isState(INACTIVE)) { updateParentBoundingInfo(entry); + resetVisible(); } } @@ -441,6 +442,7 @@ void LLVOCacheEntry::updateParentBoundingInfo() { updateParentBoundingInfo(mChildrenList[i]); } + resetVisible(); } //make the parent bounding box to include this child |