Implmented GLTF Compile and Load Overhaul #404

Merged
XiaoQiDigipen merged 17 commits from SP3-13-Assets-Manager into main 2023-03-07 23:27:01 +08:00
1 changed files with 6 additions and 3 deletions
Showing only changes of commit d4081a7e09 - Show all commits

View File

@ -174,13 +174,14 @@ namespace SHADE
reinterpret_cast<char*>(&node.inverseBindMatrix),
sizeof(SHMatrix)
);
node.inverseBindMatrix = SHMatrix::Transpose(node.inverseBindMatrix);
NodeDataFlag flag;
file.get(reinterpret_cast<char&>(flag));
SHVec3 scale{ SHVec3::One }, translation{ SHVec3::Zero };
SHVec4 rotation{ SHVec4::UnitW };
//SHMatrix matrix{ SHMatrix::Identity };
SHMatrix matrix{ SHMatrix::Identity };
std::vector<double> 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;
}
}