From c978542a068578091eb43cab024bd929f0eaaedd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 7 Jun 2016 15:06:49 -0400 Subject: MAINT-6484 - make the attachment pos updates a bit smarter, so we don't flag the pelvis has having changed unless it has actually changed. Avoid excess calls to computeBodySize(), which can cause a vertical position glitch. --- indra/newview/llvoavatar.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0423f0e380..137d172c14 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5452,19 +5452,29 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //Set the joint position + LLUUID curr_mesh_id; + LLVector3 curr_joint_pos; + if (!pJoint->hasAttachmentPosOverride( curr_joint_pos, curr_mesh_id ) || + curr_joint_pos != jointPos) + { + //If joint is a pelvis then handle old/new pelvis to foot values + if ( lookingForJoint == "mPelvis" ) + { + pelvisGotSet = true; + } + } pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); - //If joint is a pelvis then handle old/new pelvis to foot values - if ( lookingForJoint == "mPelvis" ) - { - pelvisGotSet = true; - } } } if (pelvisZOffset != 0.0F) { + F32 curr_pelvis_fixup; + if (!hasPelvisFixup(curr_pelvis_fixup) || (curr_pelvis_fixup != pelvisZOffset)) + { + pelvisGotSet = true; + } addPelvisFixup( pelvisZOffset, mesh_id ); - pelvisGotSet = true; } } } -- cgit v1.2.3