diff options
author | prep linden <prep@lindenlab.com> | 2010-09-24 13:11:53 -0400 |
---|---|---|
committer | prep linden <prep@lindenlab.com> | 2010-09-24 13:11:53 -0400 |
commit | c7f5a9419b4b93efdc04ebfbb8e05a2ef0e09142 (patch) | |
tree | d4bd4000daf955114e9dc1ed96a873b620115299 /indra/newview/llvovolume.cpp | |
parent | e0588af08737177f8a1bc519376073e14b886434 (diff) |
Added support for joint offsets
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rwxr-xr-x | indra/newview/llvovolume.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index d96b6eccb1..ed9ea2320e 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4027,6 +4027,32 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //get drawpool of avatar with rigged face LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj); + //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(); + if ( pAvatarVO ) + { + const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( vobj->getVolume()->getParams().getSculptID() ); + if ( pSkinData ) + { + static const int bindCnt = pSkinData->mAlternateBindMatrix.size(); + if ( bindCnt > 0 ) + { + static 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 ); + if ( pJoint ) + { + pJoint->storeCurrentXform( pSkinData->mAlternateBindMatrix[i].getTranslation() ); + } + } + } + } + } + if (pool) { const LLTextureEntry* te = facep->getTextureEntry(); |