diff options
-rw-r--r-- | indra/llcharacter/llcharacter.h | 18 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 2 |
3 files changed, 23 insertions, 20 deletions
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 6da28f0692..6143ec8cd1 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -245,6 +245,24 @@ public: S32 getVisualParamCount() const { return (S32)mVisualParamIndexMap.size(); } LLVisualParam* getVisualParam(const char *name); + void animateTweakableVisualParams(F32 delta) + { + for (auto& it : mVisualParamIndexMap) + { + if (it.second->isTweakable()) + { + it.second->animate(delta); + } + } + } + + void applyAllVisualParams(ESex avatar_sex) + { + for (auto& it : mVisualParamIndexMap) + { + it.second->apply(avatar_sex); + } + } ESex getSex() const { return mSex; } void setSex( ESex sex ) { mSex = sex; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b3b8969faa..f813df3fb5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3081,30 +3081,15 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() } else { - F32 morph_amt = calcMorphAmount(); - LLVisualParam *param; - if (!isSelf()) { + F32 morph_amt = calcMorphAmount(); // animate only top level params for non-self avatars - for (param = getFirstVisualParam(); - param; - param = getNextVisualParam()) - { - if (param->isTweakable()) - { - param->animate(morph_amt); - } - } + animateTweakableVisualParams(morph_amt); } // apply all params - for (param = getFirstVisualParam(); - param; - param = getNextVisualParam()) - { - param->apply(avatar_sex); - } + applyAllVisualParams(avatar_sex); mLastAppearanceBlendTime = appearance_anim_time; } @@ -3112,7 +3097,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() } } -F32 LLVOAvatar::calcMorphAmount() +F32 LLVOAvatar::calcMorphAmount() const { F32 appearance_anim_time = mAppearanceMorphTimer.getElapsedTimeF32(); F32 blend_frac = calc_bouncy_animation(appearance_anim_time / APPEARANCE_MORPH_TIME); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 2144be1ba5..aa6aee0de5 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -422,7 +422,7 @@ protected: bool updateIsFullyLoaded(); bool processFullyLoadedChange(bool loading); void updateRuthTimer(bool loading); - F32 calcMorphAmount(); + F32 calcMorphAmount() const; private: bool mFirstFullyVisible; |