2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 03:47:43 +00:00

ANIM cook fix; OBB generation crash fix

This commit is contained in:
Jack Andersen
2018-06-15 16:26:58 -10:00
parent 513d9c99cd
commit 079c343557
5 changed files with 18 additions and 6 deletions

View File

@@ -649,10 +649,14 @@ ANIM::ANIM(const BlenderAction& act,
newAnim.chanKeys.emplace_back();
std::vector<DNAANIM::Value>& rotVals = newAnim.chanKeys.back();
rotVals.reserve(chan.keys.size());
float sign = 0.f;
for (const BlenderAction::Channel::Key& key : chan.keys)
{
zeus::CQuaternion q(key.rotation.val);
q = rig.restoreRotation(newChan.id, q);
if (sign == 0.f)
sign = q.w < 0.f ? -1.f : 1.f;
q *= sign;
rotVals.emplace_back(q.w, q.x, q.y, q.z);
}