Implmented GLTF Compile and Load Overhaul #404
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue