setRest method
Every node back to model's rest pose. A node the file gave as a
matrix keeps identity values here (it is never animated).
Implementation
void setRest(ModelData model) {
for (var n = 0; n < nodeCount && n < model.nodes.length; n++) {
final node = model.nodes[n];
final t = node.translation, r = node.rotation, s = node.scale;
translations[n * 3] = t?.x ?? 0;
translations[n * 3 + 1] = t?.y ?? 0;
translations[n * 3 + 2] = t?.z ?? 0;
rotations[n * 4] = r?.x ?? 0;
rotations[n * 4 + 1] = r?.y ?? 0;
rotations[n * 4 + 2] = r?.z ?? 0;
rotations[n * 4 + 3] = r?.w ?? 1;
scales[n * 3] = s?.x ?? 1;
scales[n * 3 + 1] = s?.y ?? 1;
scales[n * 3 + 2] = s?.z ?? 1;
}
}