Commit 34770cbf authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

SL-9805 - reduce frequency of dynamic box updates to every N frames, staggered. Currently N is 4.

parent 1f09b90a
......@@ -1271,8 +1271,18 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
calculateSpatialExtents(newMin,newMax);
mLastAnimExtents[0].set(newMin.getF32ptr());
mLastAnimExtents[1].set(newMax.getF32ptr());
mLastAnimBasePos = mPelvisp->getWorldPosition();
mNeedsExtentUpdate = false;
}
else
{
LLVector3 new_base_pos = mPelvisp->getWorldPosition();
LLVector3 shift = new_base_pos-mLastAnimBasePos;
mLastAnimExtents[0] += shift;
mLastAnimExtents[1] += shift;
mLastAnimBasePos = new_base_pos;
}
if (isImpostor() && !needsImpostorUpdate())
{
......@@ -2443,7 +2453,16 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
}
// Update should be happening max once per frame.
mNeedsExtentUpdate = true;
const S32 upd_freq = 4; // force update every upd_freq frames.
if ((mLastAnimExtents[0]==LLVector3())||
(mLastAnimExtents[1])==LLVector3())
{
mNeedsExtentUpdate = true;
}
else
{
mNeedsExtentUpdate = ((LLDrawable::getCurrentFrame()+mID.mData[0])%upd_freq==0);
}
LLScopedContextString str("avatar_idle_update " + getFullname());
......
......@@ -543,6 +543,7 @@ private:
F32 mImpostorDistance;
F32 mImpostorPixelArea;
LLVector3 mLastAnimExtents[2];
LLVector3 mLastAnimBasePos;
LLCachedControl<bool> mRenderUnloadedAvatar;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment