summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprep linden <prep@lindenlab.com>2010-12-03 13:02:34 -0500
committerprep linden <prep@lindenlab.com>2010-12-03 13:02:34 -0500
commit4e922949a9a1e508a698ce5a03657f1417252d9f (patch)
tree01bee4096bb698e858e3e4ea60a428e92e052f4c
parent963e3346b1c81590d0c31097912e6481515f3722 (diff)
Fix for SH-479
-rw-r--r--indra/llcharacter/lljoint.h3
-rw-r--r--indra/newview/llvoavatar.cpp58
-rw-r--r--indra/newview/llvoavatarself.cpp6
-rw-r--r--indra/newview/llvovolume.cpp6
4 files changed, 39 insertions, 34 deletions
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index 4c8bd690e8..cbfca588b0 100644
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -83,6 +83,7 @@ protected:
LLXformMatrix mOldXform;
LLXformMatrix mDefaultXform;
+ LLUUID mId;
public:
U32 mDirtyFlags;
BOOL mUpdateXform;
@@ -182,6 +183,8 @@ public:
void setDefaultFromCurrentXform( void );
void storeCurrentXform( const LLVector3& pos );
+ LLUUID getId( void ) { return mId; }
+ void setId( const LLUUID& id ) { mId = id;}
};
#endif // LL_LLJOINT_H
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" )