benikabocha / saba

OpenGL Viewer (OBJ PMD PMX)
MIT License
442 stars 60 forks source link

Bug in loading bone morph data #36

Closed ljghy closed 1 year ago

ljghy commented 1 year ago

At Saba/Model/MMD/PMXModel.cpp line 739:

boneMorphElem.m_rotate = glm::quat_cast(rot1);

the internal order of the quaternion seems inconsistent with that returned from node->GetRotate(), so it goes wrong at PMXModel.cpp line 1268

glm::quat q = glm::slerp(node->GetRotate(), boneMorph.m_rotate, weight);

when interpolating the quaternion. I tried two versions of glm, the one in this repo and the newest version, and they both have this problem, and the order of the quaternions is not even the same between the two versions.