diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-09-27 17:29:22 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-09-27 17:29:22 -0400 |
commit | e6297ab3d6262014d3b501703154437bea523be1 (patch) | |
tree | 266a9936ed7240a4cf28d1d21cf850e9fa9e5138 /indra/newview/llskinningutil.cpp | |
parent | 996861e21bf165d73ebd80eae50ad1e8f61ee55d (diff) |
SL-451 - support for getJoint() by number, use in initSkinningMatrixPalette()
Diffstat (limited to 'indra/newview/llskinningutil.cpp')
-rw-r--r-- | indra/newview/llskinningutil.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index d69432ad21..e1333b8352 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -203,6 +203,7 @@ void LLSkinningUtil::remapSkinInfoJoints(LLVOAvatar *avatar, LLMeshSkinInfo* ski // Apply the remap to mJointNames, mInvBindMatrix, and mAlternateBindMatrix std::vector<std::string> new_joint_names; + std::vector<S32> new_joint_nums; std::vector<LLMatrix4> new_inv_bind_matrix; std::vector<LLMatrix4> new_alternate_bind_matrix; @@ -211,6 +212,7 @@ void LLSkinningUtil::remapSkinInfoJoints(LLVOAvatar *avatar, LLMeshSkinInfo* ski if (j_proxy[j] == j && new_joint_names.size() < max_joints) { new_joint_names.push_back(skin->mJointNames[j]); + new_joint_nums.push_back(-1); new_inv_bind_matrix.push_back(skin->mInvBindMatrix[j]); if (!skin->mAlternateBindMatrix.empty()) { @@ -245,7 +247,19 @@ void LLSkinningUtil::initSkinningMatrixPalette( // Note that we are mostly passing Matrix4a's to this routine anyway, just dubiously casted. for (U32 j = 0; j < count; ++j) { - LLJoint* joint = avatar->getJoint(skin->mJointNames[j]); + LLJoint *joint = NULL; + if (skin->mJointNums[j] == -1) + { + joint = avatar->getJoint(skin->mJointNames[j]); + if (joint) + { + skin->mJointNums[j] = joint->getJointNum(); + } + } + else + { + joint = avatar->getJoint(skin->mJointNums[j]); + } mat[j] = skin->mInvBindMatrix[j]; if (joint) { |