diff options
author | Graham Madarasz (Graham) <graham@lindenlab.com> | 2013-03-08 15:31:37 -0800 |
---|---|---|
committer | Graham Madarasz (Graham) <graham@lindenlab.com> | 2013-03-08 15:31:37 -0800 |
commit | f061b2b90e34d74b9c6db3606babb0402473a24d (patch) | |
tree | feae72bd1acefaa7437250035ec0c32be02c731c /indra/llui/lllayoutstack.cpp | |
parent | 4b67d34c7e31e7dcc8185061e4a0b02c5da6560a (diff) |
Optimize interp code to elim hundreds of divides per frame and fix jitter bugs.
Diffstat (limited to 'indra/llui/lllayoutstack.cpp')
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 4c730286da..c93f538570 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -229,7 +229,10 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mOpenTimeConstant(p.open_time_constant), mCloseTimeConstant(p.close_time_constant), mResizeBarOverlap(p.resize_bar_overlap) -{} +{ + LLCriticalDamp::setInterpolantConstant(InterpDeltaCloseTime, mCloseTimeConstant); + LLCriticalDamp::setInterpolantConstant(InterpDeltaOpenTime, mOpenTimeConstant); +} LLLayoutStack::~LLLayoutStack() { @@ -592,7 +595,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(InterpDeltaOpenTime)); if (panelp->mVisibleAmt > 0.99f) { panelp->mVisibleAmt = 1.f; @@ -617,7 +620,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(InterpDeltaCloseTime)); if (panelp->mVisibleAmt < 0.001f) { panelp->mVisibleAmt = 0.f; @@ -644,7 +647,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(InterpDeltaCloseTime)); } if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f) @@ -855,3 +858,4 @@ void LLLayoutStack::updateResizeBarLimits() previous_visible_panelp = visible_panelp; } } + |