From 4e922949a9a1e508a698ce5a03657f1417252d9f Mon Sep 17 00:00:00 2001 From: prep linden Date: Fri, 3 Dec 2010 13:02:34 -0500 Subject: Fix for SH-479 --- indra/newview/llvoavatar.cpp | 58 ++++++++++++++++++++-------------------- indra/newview/llvoavatarself.cpp | 6 ++--- indra/newview/llvovolume.cpp | 6 +++-- 3 files changed, 36 insertions(+), 34 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7e9a6f64f2..34345f2471 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3447,14 +3447,14 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) LLVector3d ground_under_pelvis; if (isSelf()) - { - if ( !mHasPelvisOffset ) - { - gAgent.setPositionAgent(getRenderPosition()); - } - else - { - gAgent.setPositionAgent( getRenderPosition() + mPelvisOffset ); + { + if ( !mHasPelvisOffset ) + { + gAgent.setPositionAgent(getRenderPosition()); + } + else + { + gAgent.setPositionAgent( getRenderPosition() + mPelvisOffset ); } } @@ -3472,22 +3472,22 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) mInAir = in_air; // correct for the fact that the pelvis is not necessarily the center - // of the agent's physical representation + // of the agent's physical representation root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); if (newPosition != mRoot.getXform()->getWorldPosition()) { - if ( !mHasPelvisOffset ) - { - mRoot.touch(); - mRoot.setWorldPosition( newPosition ); // regular update - } - else - { - mRoot.touch(); - mRoot.setWorldPosition( newPosition + mPelvisOffset ); + if ( !mHasPelvisOffset ) + { + mRoot.touch(); + mRoot.setWorldPosition( newPosition ); // regular update + } + else + { + mRoot.touch(); + mRoot.setWorldPosition( newPosition + mPelvisOffset ); } } @@ -3792,21 +3792,21 @@ void LLVOAvatar::updateHeadOffset() //------------------------------------------------------------------------ // setPelvisOffset //------------------------------------------------------------------------ -void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount ) -{ - mHasPelvisOffset = hasOffset; - if ( mHasPelvisOffset ) - { - mPelvisOffset = offsetAmount; - } -} +void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount ) +{ + mHasPelvisOffset = hasOffset; + if ( mHasPelvisOffset ) + { + mPelvisOffset = offsetAmount; + } +} //------------------------------------------------------------------------ // postPelvisSetRecalc //------------------------------------------------------------------------ void LLVOAvatar::postPelvisSetRecalc( void ) { - computeBodySize(); - mRoot.updateWorldMatrixChildren(); + computeBodySize(); + mRoot.updateWorldMatrixChildren(); dirtyMesh(); updateHeadOffset(); } @@ -4975,7 +4975,7 @@ void LLVOAvatar::resetJointPositionsToDefault( void ) //restore joints to default positions, however skip over the pelvis if ( pJoint && pPelvis != pJoint ) { - pJoint->restoreToDefaultXform(); + pJoint->restoreOldXform(); } } //make sure we don't apply the joint offset diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6fa3da9b41..5054aa3c9e 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -650,10 +650,10 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) } return LLVOAvatar::getJoint(name); } - +//virtual void LLVOAvatarSelf::resetJointPositions( void ) { - return LLVOAvatar::resetJointPositionsToDefault(); + return LLVOAvatar::resetJointPositions(); } // virtual BOOL LLVOAvatarSelf::setVisualParamWeight(LLVisualParam *which_param, F32 weight, BOOL upload_bake ) @@ -1161,7 +1161,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) const int bindCnt = pSkinData->mAlternateBindMatrix.size(); if ( bindCnt > 0 ) { - resetJointPositions(); + LLVOAvatar::resetJointPositionsToDefault(); } } } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 39e286ac38..fa0f48fce6 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4057,7 +4057,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if ( pAvatarVO ) { - const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( vobj->getVolume()->getParams().getSculptID() ); + LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); + const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId ); if ( pSkinData ) { @@ -4069,8 +4070,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { std::string lookingForJoint = pSkinData->mJointNames[i].c_str(); LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint ); - if ( pJoint ) + if ( pJoint && pJoint->getId() != currentId ) { + pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //If joint is a pelvis then handle by setting avPos+offset if ( lookingForJoint == "mPelvis" ) -- cgit v1.2.3