Tranpose Inverse Bind Matrix

WIP, building transform matrix not working
This commit is contained in:
Xiao Qi 2023-03-04 03:20:01 +08:00
parent 56693565f4
commit d4081a7e09
1 changed files with 6 additions and 3 deletions

View File

@ -174,13 +174,14 @@ namespace SHADE
reinterpret_cast<char*>(&node.inverseBindMatrix), reinterpret_cast<char*>(&node.inverseBindMatrix),
sizeof(SHMatrix) sizeof(SHMatrix)
); );
node.inverseBindMatrix = SHMatrix::Transpose(node.inverseBindMatrix);
NodeDataFlag flag; NodeDataFlag flag;
file.get(reinterpret_cast<char&>(flag)); file.get(reinterpret_cast<char&>(flag));
SHVec3 scale{ SHVec3::One }, translation{ SHVec3::Zero }; SHVec3 scale{ SHVec3::One }, translation{ SHVec3::Zero };
SHVec4 rotation{ SHVec4::UnitW }; SHVec4 rotation{ SHVec4::UnitW };
//SHMatrix matrix{ SHMatrix::Identity }; SHMatrix matrix{ SHMatrix::Identity };
std::vector<double> carrier; std::vector<double> carrier;
if (flag & NODE_DATA_ROTATION) if (flag & NODE_DATA_ROTATION)
@ -223,8 +224,10 @@ namespace SHADE
// matrix = GetMatrixFromVector(carrier); // matrix = GetMatrixFromVector(carrier);
//} //}
auto const result = SHMatrix::Transform(translation, rotation, scale); //matrix *= SHMatrix::Transform(translation, rotation, scale);
node.transform = result; matrix *= SHMatrix::Translate(translation) * SHMatrix::Rotate(rotation) * SHMatrix::Scale(scale);
//result = SHMatrix::Transpose(result);
node.transform = matrix;
} }
} }