The element MLMatrix44 is a list, so values are separed by spaces and carriage return are ignored.

This commit is contained in:
Dʳ Pierre-Édouard Cailliau 2022-01-23 00:14:43 +01:00
parent a623f22dac
commit c48cb4da97
No known key found for this signature in database
GPG Key ID: 0B3A4F36A195A1E8

View File

@ -230,20 +230,10 @@ std::vector<MeshModel*> loadMLP(
vcg::Matrix44f trm;
if (tr.childNodes().size() == 1) {
if (!binary) {
QStringList rows = tr.firstChild().nodeValue().split("\n", QString::SkipEmptyParts);
int i = 0;
for (const QString& row : qAsConst(rows)){
if (rows.size() > 0) {
QStringList values = row.split(" ", QString::SkipEmptyParts);
int j = 0;
for (const QString& value : qAsConst(values)) {
if (i < 4 && j < 4) {
md.mm()->cm.Tr[i][j] = value.toFloat();
j++;
}
}
i++;
}
auto const & values = tr.childNodes();
auto * v = md.mm()->cm.V();
for (auto index = 0u; index < values.length(); ++index) {
v[index] = values.item(index).nodeName().toFloat();
}
}
else {