summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingsbase.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-05-16 13:42:48 -0700
committerRider Linden <rider@lindenlab.com>2018-05-16 13:42:48 -0700
commit4975bd03c12673778616e1cca1811bf906bb42a6 (patch)
tree766dcc54d2a3980b4e8ec329bc1f747cfa68294c /indra/llinventory/llsettingsbase.cpp
parent3925e37532476c526375fd76143b2b5e1dcce9b9 (diff)
Splitting the blender up to support manual positioning as well as time. Phase1
Diffstat (limited to 'indra/llinventory/llsettingsbase.cpp')
-rw-r--r--indra/llinventory/llsettingsbase.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp
index f2dfeaf154..daf42fc073 100644
--- a/indra/llinventory/llsettingsbase.cpp
+++ b/indra/llinventory/llsettingsbase.cpp
@@ -52,8 +52,6 @@ const std::string LLSettingsBase::SETTING_NAME("name");
const std::string LLSettingsBase::SETTING_HASH("hash");
const std::string LLSettingsBase::SETTING_TYPE("type");
-const F64Seconds LLSettingsBlender::DEFAULT_THRESHOLD(0.01);
-
//=========================================================================
LLSettingsBase::LLSettingsBase():
mSettings(LLSD::emptyMap()),
@@ -535,21 +533,37 @@ bool LLSettingsBase::Validator::verifyIntegerRange(LLSD &value, LLSD range)
}
//=========================================================================
-void LLSettingsBlender::update(F64Seconds timedelta)
+void LLSettingsBlender::update(F64 blendf)
{
- mTimeSpent += timedelta;
- if (mTimeSpent >= mSeconds)
+}
+
+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());
- return;
+ return 1.0;
}
-
- F64 blendf = fmod(mTimeSpent.value(), mSeconds.value()) / mSeconds.value();
+ blendf = llclamp(blendf, 0.0, 1.0);
//_WARNS("LAPRAS") << "blending at " << (blendf * 100.0f) << "%" << LL_ENDL;
mTarget->replaceSettings(mInitial->getSettings());
mTarget->blend(mFinal, blendf);
+
+ return blendf;
}
+//-------------------------------------------------------------------------
+void LLSettingsBlenderTimeDelta::update(F64 timedelta)
+{
+ mTimeSpent += F64Seconds(timedelta);
+
+ F64 blendf = fmod(mTimeSpent.value(), mBlendSpan.value()) / mBlendSpan.value();
+
+ // Note no clamp here.
+
+ setPosition(blendf);
+}