summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llviewerregion.cpp4
-rwxr-xr-xindra/newview/llvocache.cpp9
-rwxr-xr-xindra/newview/llvocache.h2
3 files changed, 6 insertions, 9 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 23660dd3ce..cbce2674a7 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1071,6 +1071,8 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time)
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;
+ LLVector4a local_origin;
+ local_origin.load3((camera_origin - getOriginAgent()).mV);
//process visible entries
for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mVisibleEntries.begin(); iter != mImpl->mVisibleEntries.end();)
@@ -1149,7 +1151,7 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time)
continue;
}
- vo_entry->calcSceneContribution(camera_origin, needs_update, last_update);
+ vo_entry->calcSceneContribution(local_origin, needs_update, last_update);
mImpl->mWaitingList.insert(vo_entry);
}
}
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 72270eec46..b1c7423b49 100755
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -383,20 +383,15 @@ bool LLVOCacheEntry::isRecentlyVisible() const
return vis;
}
-void LLVOCacheEntry::calcSceneContribution(const LLVector3& camera_origin, bool needs_update, U32 last_update)
+void LLVOCacheEntry::calcSceneContribution(const LLVector4a& camera_origin, bool needs_update, U32 last_update)
{
if(!needs_update && getVisible() >= last_update)
{
return; //no need to update
}
- const LLVector4a& center = getPositionGroup();
-
- LLVector4a origin;
- origin.load3(camera_origin.mV);
-
LLVector4a lookAt;
- lookAt.setSub(center, origin);
+ lookAt.setSub(getPositionGroup(), camera_origin);
F32 squared_dist = lookAt.dot3(lookAt).getF32();
if(squared_dist > 0.f)
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 3ee9dcaac8..446111620d 100755
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -93,7 +93,7 @@ public:
S32 getHitCount() const { return mHitCount; }
S32 getCRCChangeCount() const { return mCRCChangeCount; }
- void calcSceneContribution(const LLVector3& camera_origin, bool needs_update, U32 last_update);
+ void calcSceneContribution(const LLVector4a& camera_origin, bool needs_update, U32 last_update);
void setSceneContribution(F32 scene_contrib) {mSceneContrib = scene_contrib;}
F32 getSceneContribution() const { return mSceneContrib;}