diff options
author | Rider Linden <rider@lindenlab.com> | 2018-05-17 12:05:31 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-05-17 12:05:31 -0700 |
commit | b117a9ea197a084eeec1e8330dbe7c562423e248 (patch) | |
tree | e1fd0a023c0ac2116ae36da4022aa37ffc39c0f5 /indra/llinventory/llsettingsbase.cpp | |
parent | 3d224c66cbb449b99545b93fb9742f32aca4ad5d (diff) |
Fix end of cycle trigger for time blender.
Diffstat (limited to 'indra/llinventory/llsettingsbase.cpp')
-rw-r--r-- | indra/llinventory/llsettingsbase.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index daf42fc073..a6a7a9acf9 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -542,9 +542,7 @@ F64 LLSettingsBlender::setPosition(F64 blendf) { if (blendf >= 1.0) { - mTarget->replaceSettings(mFinal->getSettings()); - LLSettingsBlender::ptr_t hold = shared_from_this(); // prevents this from deleting too soon - mOnFinished(shared_from_this()); + triggerComplete(); return 1.0; } blendf = llclamp(blendf, 0.0, 1.0); @@ -556,11 +554,24 @@ F64 LLSettingsBlender::setPosition(F64 blendf) return blendf; } +void LLSettingsBlender::triggerComplete() +{ + mTarget->replaceSettings(mFinal->getSettings()); + LLSettingsBlender::ptr_t hold = shared_from_this(); // prevents this from deleting too soon + mOnFinished(shared_from_this()); +} + //------------------------------------------------------------------------- void LLSettingsBlenderTimeDelta::update(F64 timedelta) { mTimeSpent += F64Seconds(timedelta); + if (mTimeSpent > mBlendSpan) + { + triggerComplete(); + return; + } + F64 blendf = fmod(mTimeSpent.value(), mBlendSpan.value()) / mBlendSpan.value(); // Note no clamp here. |