summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llvoavatar.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index e6df4f4fd1..9bfb402b03 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5315,6 +5315,13 @@ void LLVOAvatar::clearAttachmentPosOverrides()
}
}
+bool above_joint_pos_threshold(const LLVector3& diff)
+{
+ return !diff.isNull();
+ //const F32 max_joint_pos_offset = 0.0001f; // 0.1 mm
+ //return diff.lengthSquared() > max_joint_pos_offset * max_joint_pos_offset;
+}
+
//-----------------------------------------------------------------------------
// addAttachmentPosOverridesForObject
//-----------------------------------------------------------------------------
@@ -5375,7 +5382,7 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo)
{
pJoint->setId( currentId );
const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation();
- if ((jointPos-pJoint->getDefaultPosition()).isNull())
+ if (!above_joint_pos_threshold(jointPos-pJoint->getDefaultPosition()))
{
LL_DEBUGS("Avatar") << "Attachment pos override ignored for " << pJoint->getName()
<< ", pos " << jointPos << " is same as default pos" << LL_ENDL;
@@ -5408,7 +5415,10 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo)
postPelvisSetRecalc();
}
- showAttachmentPosOverrides();
+ if (isSelf())
+ {
+ showAttachmentPosOverrides();
+ }
}
//-----------------------------------------------------------------------------