diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-09-28 11:53:01 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-09-28 11:53:01 -0400 |
commit | 5460c0f4c80660f93723a80d464c0a5ebd97921a (patch) | |
tree | 0d0b129d93ff2a3cb0dfbe30bd51472214fbb0fb /indra/newview/llfloatermodelpreview.cpp | |
parent | 924e4292e7a2a11ef01a5703e52116037180aa06 (diff) |
SL-227 WIP - standardize usage of shared skinning code and handle additional error case in weights.
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 7e5d3a9f29..0736f1eac4 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -5573,26 +5573,30 @@ BOOL LLModelPreview::render() //build matrix palette - LLMatrix4 mat[LL_MAX_JOINTS_PER_MESH_OBJECT]; - U32 count = llmin((U32) model->mSkinInfo.mJointNames.size(), (U32) LL_MAX_JOINTS_PER_MESH_OBJECT); - LLDrawPoolAvatar::initSkinningMatrixPalette(mat, count, &model->mSkinInfo, getPreviewAvatar()); - + LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT]; + const LLMeshSkinInfo *skin = &model->mSkinInfo; + U32 count = llmin((U32) skin->mJointNames.size(), (U32) LL_MAX_JOINTS_PER_MESH_OBJECT); + LLDrawPoolAvatar::initSkinningMatrixPalette((LLMatrix4*)mat, count, + skin, getPreviewAvatar()); + LLMatrix4a bind_shape_matrix; + bind_shape_matrix.loadu(skin->mBindShapeMatrix); for (U32 j = 0; j < buffer->getNumVerts(); ++j) { - LLMatrix4a final_mata; - LLDrawPoolAvatar::getPerVertexSkinMatrix(weight[j].mV, (LLMatrix4a*)mat, true, final_mata); - - // BENTO GROSS KLUDGERY - LLMatrix4 final_mat; - memcpy(&final_mat,&final_mata,sizeof(LLMatrix4a)); + LLMatrix4a final_mat; + F32 *wptr = weight[j].mV; + LLDrawPoolAvatar::getPerVertexSkinMatrix(wptr, mat, true, final_mat); //VECTORIZE THIS - LLVector3 v(face.mPositions[j].getF32ptr()); + LLVector4a& v = face.mPositions[j]; - v = v * model->mSkinInfo.mBindShapeMatrix; - v = v * final_mat; + LLVector4a t; + LLVector4a dst; + bind_shape_matrix.affineTransform(v, t); + final_mat.affineTransform(t, dst); - position[j] = v; + position[j][0] = dst[0]; + position[j][1] = dst[1]; + position[j][2] = dst[2]; } llassert(model->mMaterialList.size() > i); |