summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorprep linden <prep@lindenlab.com>2010-09-24 13:11:53 -0400
committerprep linden <prep@lindenlab.com>2010-09-24 13:11:53 -0400
commitc7f5a9419b4b93efdc04ebfbb8e05a2ef0e09142 (patch)
treed4bd4000daf955114e9dc1ed96a873b620115299 /indra/newview/llvovolume.cpp
parente0588af08737177f8a1bc519376073e14b886434 (diff)
Added support for joint offsets
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rwxr-xr-xindra/newview/llvovolume.cpp26
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();