diff options
Diffstat (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp')
-rw-r--r-- | indra/llappearance/llpolyskeletaldistortion.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 4ba16691c2..eb86f77d97 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -192,7 +192,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) { LLFastTimer t(FTM_POLYSKELETAL_DISTORTION_APPLY); - F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); + F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); LLJoint* joint; joint_vec_map_t::iterator iter; @@ -204,8 +204,10 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) joint = iter->first; LLVector3 newScale = joint->getScale(); LLVector3 scaleDelta = iter->second; - newScale = newScale + (effective_weight * scaleDelta) - (mLastWeight * scaleDelta); - joint->setScale(newScale); + newScale = newScale + (effective_weight * scaleDelta) - (mLastWeight * scaleDelta); + //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached + joint->storeScaleForReset( newScale ); + joint->setScale(newScale); } for (iter = mJointOffsets.begin(); @@ -214,8 +216,8 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) { joint = iter->first; LLVector3 newPosition = joint->getPosition(); - LLVector3 positionDelta = iter->second; - newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); + LLVector3 positionDelta = iter->second; + newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); joint->setPosition(newPosition); } |