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.

meow-7.2.2
Brad Payne (Vir Linden) 2016-06-07 15:06:49 -04:00
parent e46ac9d144
commit c978542a06
1 changed files with 16 additions and 6 deletions

View File

@ -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;
}
}
}