summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-05-12 10:57:08 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-05-12 10:57:08 -0400
commitd0dea44c010ec4e747b139ce55013e3203ba980a (patch)
tree68f9458a7fa2cbbcb903b9b59cc88e0b6ce52ff9 /indra/newview/llvoavatar.cpp
parent182f2a48159e231149227e1cd606b3d7ead04dcd (diff)
SL-315 - resetSkeleton(). Still some small scale discrepancies, visually pretty good.
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rwxr-xr-xindra/newview/llvoavatar.cpp21
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;
}
//-----------------------------------------------------------------------------