commit
878d0745d3
|
@ -285,9 +285,6 @@ void MD5Importer::AttachChilds_Mesh(int iParentID,aiNode* piParent, BoneList& bo
|
||||||
aiQuaternion quat;
|
aiQuaternion quat;
|
||||||
MD5::ConvertQuaternion ( bones[i].mRotationQuat, quat );
|
MD5::ConvertQuaternion ( bones[i].mRotationQuat, quat );
|
||||||
|
|
||||||
// FIX to get to Assimp's quaternion conventions
|
|
||||||
quat.w *= -1.f;
|
|
||||||
|
|
||||||
bones[i].mTransform = aiMatrix4x4 ( quat.GetMatrix());
|
bones[i].mTransform = aiMatrix4x4 ( quat.GetMatrix());
|
||||||
bones[i].mTransform.a4 = bones[i].mPositionXYZ.x;
|
bones[i].mTransform.a4 = bones[i].mPositionXYZ.x;
|
||||||
bones[i].mTransform.b4 = bones[i].mPositionXYZ.y;
|
bones[i].mTransform.b4 = bones[i].mPositionXYZ.y;
|
||||||
|
@ -656,9 +653,6 @@ void MD5Importer::LoadMD5AnimFile ()
|
||||||
|
|
||||||
MD5::ConvertQuaternion(vTemp, qKey->mValue);
|
MD5::ConvertQuaternion(vTemp, qKey->mValue);
|
||||||
qKey->mTime = vKey->mTime = dTime;
|
qKey->mTime = vKey->mTime = dTime;
|
||||||
|
|
||||||
// we need this to get to Assimp quaternion conventions
|
|
||||||
qKey->mValue.w *= -1.f;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,6 +262,9 @@ inline void ConvertQuaternion (const aiVector3D& in, aiQuaternion& out) {
|
||||||
if (t < 0.0f)
|
if (t < 0.0f)
|
||||||
out.w = 0.0f;
|
out.w = 0.0f;
|
||||||
else out.w = std::sqrt (t);
|
else out.w = std::sqrt (t);
|
||||||
|
|
||||||
|
// Assimp convention.
|
||||||
|
out.w *= -1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue