From e286d1743d3833e9dd299fd4f5473db686284690 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 2 Jul 2018 19:43:13 +0100 Subject: MAINT-8671 - change in bind shape -> quaternion math. --- indra/newview/llcontrolavatar.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 8c10ececb6..f828ed783e 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -141,7 +141,24 @@ void LLControlAvatar::matchVolumeTransform() const LLMeshSkinInfo* skin_info = mRootVolp->getSkinInfo(); if (skin_info) { + LL_DEBUGS("BindShape") << getFullname() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL; LLMatrix3 bind_mat = skin_info->mBindShapeMatrix.getMat3(); + for (auto i = 0; i < 3; i++) + { + F32 len = 0.0f; + for (auto j = 0; j < 3; j++) + { + len += bind_mat.mMatrix[i][j] * bind_mat.mMatrix[i][j]; + } + if (len >= 0.0f) + { + len = sqrt(len); + for (auto j = 0; j < 3; j++) + { + bind_mat.mMatrix[i][j] /= len; + } + } + } bind_mat.invert(); bind_rot = bind_mat.quaternion(); bind_rot.normalize(); -- cgit v1.2.3