diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-05-12 10:57:08 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-05-12 10:57:08 -0400 |
commit | d0dea44c010ec4e747b139ce55013e3203ba980a (patch) | |
tree | 68f9458a7fa2cbbcb903b9b59cc88e0b6ce52ff9 /indra/newview/llvoavatar.cpp | |
parent | 182f2a48159e231149227e1cd606b3d7ead04dcd (diff) |
SL-315 - resetSkeleton(). Still some small scale discrepancies, visually pretty good.
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e82f24a069..9286a70886 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1859,7 +1859,7 @@ void LLVOAvatar::resetVisualParams() //----------------------------------------------------------------------------- void LLVOAvatar::resetSkeleton() { - LL_DEBUGS("Avatar") << avString() << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " reset starts" << LL_ENDL; if (!mLastProcessedAppearance) { LL_WARNS() << "Can't reset avatar; no appearance message has been received yet." << LL_ENDL; @@ -1883,15 +1883,34 @@ void LLVOAvatar::resetSkeleton() bool ignore_hud_joints = true; initAttachmentPoints(ignore_hud_joints); + // Fix up collision volumes + for (LLVisualParam *param = getFirstVisualParam(); + param; + param = getNextVisualParam()) + { + LLPolyMorphTarget *poly_morph = dynamic_cast<LLPolyMorphTarget*>(param); + if (poly_morph) + { + // This is a kludgy way to correct for the fact that the + // collision volumes have been reset out from under the + // poly morph sliders. + F32 delta_weight = poly_morph->getLastWeight() - poly_morph->getDefaultWeight(); + poly_morph->applyVolumeChanges(delta_weight); + } + } + // Reset tweakable params to preserved state // Apply params applyParsedAppearanceMessage(*mLastProcessedAppearance); + updateVisualParams(); // Restore attachment pos overrides rebuildAttachmentPosOverrides(); // Restart animations + + LL_DEBUGS("Avatar") << avString() << " reset ends" << LL_ENDL; } //----------------------------------------------------------------------------- |