Use avatar-relative transforms when skinning via software, and translate to world coordinates after.

This commit is contained in:
Shyotl
2017-01-12 23:47:58 -06:00
parent aa7c5e652c
commit f62fded4bd
4 changed files with 23 additions and 5 deletions

View File

@@ -9761,12 +9761,15 @@ void LLVOAvatar::updateSoftwareSkinnedVertices(const LLMeshSkinInfo* skin, const
//build matrix palette
LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT];
U32 count = LLSkinningUtil::getMeshJointCount(skin);
LLSkinningUtil::initSkinningMatrixPalette(mat, count, skin, this);
LLSkinningUtil::initSkinningMatrixPalette(mat, count, skin, this, true);
LLSkinningUtil::checkSkinWeights(weight, buffer->getNumVerts(), skin);
LLMatrix4a bind_shape_matrix;
bind_shape_matrix.loadu(skin->mBindShapeMatrix);
LLVector4a av_pos;
av_pos.load3(getPosition().mV);
const U32 max_joints = LLSkinningUtil::getMaxJointCount();
for (U32 j = 0; j < (U32)buffer->getNumVerts(); ++j)
{
@@ -9778,6 +9781,8 @@ void LLVOAvatar::updateSoftwareSkinnedVertices(const LLMeshSkinInfo* skin, const
final_mat.mul(bind_shape_matrix);
final_mat.affineTransform(v, pos[j]);
pos[j].add(av_pos);
if (norm)
{
final_mat.invert();