diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-08-08 13:34:02 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-08-08 13:34:02 +0100 |
commit | 791979c553a09963f03239cecc90083fe3f8c657 (patch) | |
tree | bc94be84b8046f19c6a3851ce99d585dd8ca76c6 /indra/newview/llcontrolavatar.cpp | |
parent | 6ce09ad712f98fe5d0097f1de6a5d1793f5f2bdd (diff) |
SL-928 - in mesh upload, warn if bind shape is non-identity and skin weights are enabled.
Diffstat (limited to 'indra/newview/llcontrolavatar.cpp')
-rw-r--r-- | indra/newview/llcontrolavatar.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 6adb34c263..83d42f6ccf 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -33,6 +33,7 @@ #include "llviewercontrol.h" #include "llmeshrepository.h" #include "llviewerregion.h" +#include "llskinningutil.h" LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) : LLVOAvatar(id, pcode, regionp), @@ -144,26 +145,7 @@ void LLControlAvatar::matchVolumeTransform() 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(); + bind_rot = LLSkinningUtil::getUnscaledQuaternion(skin_info->mBindShapeMatrix); } #endif setRotation(bind_rot*obj_rot); |