diff options
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r-- | indra/newview/llvovolume.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e7e2830f25..0b2adc70d9 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -74,7 +74,6 @@ #include "llviewermediafocus.h" #include "llvoavatar.h" - const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; @@ -4053,23 +4052,38 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //Determine if we've received skininfo that contains an //alternate bind matrix - if it does then apply the translational component //to the joints of the avatar. - const LLVOAvatar* pAvatarVO = vobj->getAvatar(); + LLVOAvatar* pAvatarVO = vobj->getAvatar(); if ( pAvatarVO ) { const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( vobj->getVolume()->getParams().getSculptID() ); + if ( pSkinData ) { - const int bindCnt = pSkinData->mAlternateBindMatrix.size(); + const int bindCnt = pSkinData->mAlternateBindMatrix.size(); if ( bindCnt > 0 ) { const int jointCnt = pSkinData->mJointNames.size(); for ( int i=0; i<jointCnt; ++i ) { std::string lookingForJoint = pSkinData->mJointNames[i].c_str(); - LLJoint* pJoint = vobj->getAvatar()->getJoint( lookingForJoint ); + LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint ); if ( pJoint ) { - pJoint->storeCurrentXform( pSkinData->mAlternateBindMatrix[i].getTranslation() ); + const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); + pJoint->storeCurrentXform( jointPos ); + //If joint is a pelvis then handle by setting avPos+offset + //if ( !strcmp( lookingForJoint.c_str(),"mPelvis" ) )
+ if ( lookingForJoint == "mPelvis" )
+ {
+ //Apply av pos + offset
+ if ( !pAvatarVO->hasPelvisOffset() )
+ {
+ pAvatarVO->setPelvisOffset( true, jointPos );
+ pAvatarVO->setPosition( pAvatarVO->getCharacterPosition() + jointPos );
+ }
+ } + + } } } |