diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-07-02 19:43:13 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-07-02 19:43:13 +0100 |
commit | e286d1743d3833e9dd299fd4f5473db686284690 (patch) | |
tree | 812e160332a25c8210547bf6150534ed98e24288 /indra/newview | |
parent | 329fee97041f061c6508ff2a18dcc5ba49b657cc (diff) |
MAINT-8671 - change in bind shape -> quaternion math.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llcontrolavatar.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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(); |