diff --git a/SHADE_Engine/src/Assets/Libraries/Loaders/SHModelLoader.cpp b/SHADE_Engine/src/Assets/Libraries/Loaders/SHModelLoader.cpp index 7e5ed0c7..26f16d34 100644 --- a/SHADE_Engine/src/Assets/Libraries/Loaders/SHModelLoader.cpp +++ b/SHADE_Engine/src/Assets/Libraries/Loaders/SHModelLoader.cpp @@ -174,13 +174,14 @@ namespace SHADE reinterpret_cast(&node.inverseBindMatrix), sizeof(SHMatrix) ); + node.inverseBindMatrix = SHMatrix::Transpose(node.inverseBindMatrix); NodeDataFlag flag; file.get(reinterpret_cast(flag)); SHVec3 scale{ SHVec3::One }, translation{ SHVec3::Zero }; SHVec4 rotation{ SHVec4::UnitW }; - //SHMatrix matrix{ SHMatrix::Identity }; + SHMatrix matrix{ SHMatrix::Identity }; std::vector carrier; if (flag & NODE_DATA_ROTATION) @@ -223,8 +224,10 @@ namespace SHADE // matrix = GetMatrixFromVector(carrier); //} - auto const result = SHMatrix::Transform(translation, rotation, scale); - node.transform = result; + //matrix *= SHMatrix::Transform(translation, rotation, scale); + matrix *= SHMatrix::Translate(translation) * SHMatrix::Rotate(rotation) * SHMatrix::Scale(scale); + //result = SHMatrix::Transpose(result); + node.transform = matrix; } }