diff options
Diffstat (limited to 'indra/llcharacter/llvisualparam.cpp')
-rwxr-xr-x | indra/llcharacter/llvisualparam.cpp | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index 0df7fb2bc3..2235496ac5 100755 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -159,26 +159,42 @@ void LLVisualParamInfo::toStream(std::ostream &out) //----------------------------------------------------------------------------- // LLVisualParam() //----------------------------------------------------------------------------- -LLVisualParam::LLVisualParam() - : - mCurWeight( 0.f ), +LLVisualParam::LLVisualParam() + : mCurWeight( 0.f ), mLastWeight( 0.f ), mNext( NULL ), mTargetWeight( 0.f ), mIsAnimating( FALSE ), + mIsDummy(FALSE), mID( -1 ), mInfo( 0 ), - mIsDummy(FALSE), mParamLocation(LOC_UNKNOWN) { } //----------------------------------------------------------------------------- +// LLVisualParam() +//----------------------------------------------------------------------------- +LLVisualParam::LLVisualParam(const LLVisualParam& pOther) + : mCurWeight(pOther.mCurWeight), + mLastWeight(pOther.mLastWeight), + mNext(pOther.mNext), + mTargetWeight(pOther.mTargetWeight), + mIsAnimating(pOther.mIsAnimating), + mIsDummy(pOther.mIsDummy), + mID(pOther.mID), + mInfo(pOther.mInfo), + mParamLocation(pOther.mParamLocation) +{ +} + +//----------------------------------------------------------------------------- // ~LLVisualParam() //----------------------------------------------------------------------------- LLVisualParam::~LLVisualParam() { delete mNext; + mNext = NULL; } /* @@ -220,7 +236,7 @@ BOOL LLVisualParam::parseData(LLXmlTreeNode *node) //----------------------------------------------------------------------------- // setWeight() //----------------------------------------------------------------------------- -void LLVisualParam::setWeight(F32 weight, BOOL upload_bake) +void LLVisualParam::setWeight(F32 weight) { if (mIsAnimating) { @@ -238,19 +254,19 @@ void LLVisualParam::setWeight(F32 weight, BOOL upload_bake) if (mNext) { - mNext->setWeight(weight, upload_bake); + mNext->setWeight(weight); } } //----------------------------------------------------------------------------- // setAnimationTarget() //----------------------------------------------------------------------------- -void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake) +void LLVisualParam::setAnimationTarget(F32 target_value) { // don't animate dummy parameters if (mIsDummy) { - setWeight(target_value, upload_bake); + setWeight(target_value); mTargetWeight = mCurWeight; return; } @@ -270,7 +286,7 @@ void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake) if (mNext) { - mNext->setAnimationTarget(target_value, upload_bake); + mNext->setAnimationTarget(target_value); } } @@ -285,26 +301,34 @@ void LLVisualParam::setNextParam( LLVisualParam *next ) } //----------------------------------------------------------------------------- +// clearNextParam() +//----------------------------------------------------------------------------- +void LLVisualParam::clearNextParam() +{ + mNext = NULL; +} + +//----------------------------------------------------------------------------- // animate() //----------------------------------------------------------------------------- -void LLVisualParam::animate( F32 delta, BOOL upload_bake ) +void LLVisualParam::animate( F32 delta) { if (mIsAnimating) { F32 new_weight = ((mTargetWeight - mCurWeight) * delta) + mCurWeight; - setWeight(new_weight, upload_bake); + setWeight(new_weight); } } //----------------------------------------------------------------------------- // stopAnimating() //----------------------------------------------------------------------------- -void LLVisualParam::stopAnimating(BOOL upload_bake) +void LLVisualParam::stopAnimating() { if (mIsAnimating && isTweakable()) { mIsAnimating = FALSE; - setWeight(mTargetWeight, upload_bake); + setWeight(mTargetWeight); } } |