Local skinning space:

Global skinning space:

I consider this a very serious bug with global skinning.
Here is the file to reproduce: https://drive.google.com/open?id=1QOfHj ... Wfb1FC0MRG
I exported using Blender and SuperTuxKart's exporter.
Code: Select all
irr::core::matrix4 mat;
auto getMatrix = [] (SmartBody::SBJoint* inJoint) {
float* M = inJoint->getMatrixGlobal();
irr::core::matrix4 rightHandToLeft;
constexpr float boneSizeScale = 0.5f;
constexpr float bonePosScale = 0.5f;
rightHandToLeft[0] = boneSizeScale * M[0];
rightHandToLeft[1] = boneSizeScale * M[1];
rightHandToLeft[2] = boneSizeScale * M[2];
rightHandToLeft[3] = M[3];
rightHandToLeft[4] = boneSizeScale * M[8];
rightHandToLeft[5] = boneSizeScale * M[9];
rightHandToLeft[6] = boneSizeScale * M[10];
rightHandToLeft[7] = M[11];
rightHandToLeft[8] = boneSizeScale * M[4];
rightHandToLeft[9] = boneSizeScale * M[5];
rightHandToLeft[10] = boneSizeScale * M[6];
rightHandToLeft[11] = M[7];
rightHandToLeft[12] = bonePosScale * M[12];
rightHandToLeft[13] = bonePosScale * M[14];
rightHandToLeft[14] = bonePosScale * M[13];
rightHandToLeft[15] = M[15];
return rightHandToLeft;
};
mat = getMatrix(joint);
irrJoint->setSkinningSpace(irr::scene::EBSS_GLOBAL);
auto rot = mat.getRotationDegrees();
auto scale = mat.getScale();
irrJoint->setScale({scale.X, scale.Y, scale.Z});
irrJoint->setRotation(rot);
irrJoint->setPosition(mat.getTranslation());
irrJoint->updateAbsolutePosition();