From c19ef521b3264ffae42a703a0b9d9b2a3abe424b Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 19 Mar 2019 13:20:28 -0500 Subject: [PATCH] Lazy micro opt. --- indra/newview/llskinningutil.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index 71b9a5dcc..fdd580477 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -257,6 +257,10 @@ void LLSkinningUtil::updateRiggingInfo(const LLMeshSkinInfo* skin, LLVOAvatar *a //S32 active_verts = 0; vol_face.mJointRiggingInfoTab.resize(LL_CHARACTER_MAX_ANIMATED_JOINTS); LLJointRiggingInfoTab &rig_info_tab = vol_face.mJointRiggingInfoTab; + + LLMatrix4a bind_shape; + bind_shape.loadu(skin->mBindShapeMatrix); + for (S32 i=0; imInvBindMatrix[joint_index]); + LLMatrix4a mat; + mat.setMul(bind_shape, inv_bind); + LLVector4a pos_joint_space; + mat.affineTransform(pos, pos_joint_space); if (wght[k] > 0.0f) { S32 joint_num = skin->mJointNums[joint_index]; if (joint_num >= 0 && joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS) { rig_info_tab[joint_num].setIsRiggedTo(true); - - // FIXME could precompute these matMuls. - LLMatrix4a bind_shape; - bind_shape.loadu(skin->mBindShapeMatrix); - LLMatrix4a inv_bind; - inv_bind.loadu(skin->mInvBindMatrix[joint_index]); - LLMatrix4a mat; - mat.setMul(bind_shape, inv_bind); - LLVector4a pos_joint_space; - mat.affineTransform(pos, pos_joint_space); - pos_joint_space.mul(wght[k]); + LLVector4a final_pos; + final_pos.setMul(pos_joint_space, wght[k]); LLVector4a *extents = rig_info_tab[joint_num].getRiggedExtents(); - update_min_max(extents[0], extents[1], pos_joint_space); + update_min_max(extents[0], extents[1], final_pos); } } }