| 1003 | } |
| 1004 | |
| 1005 | static void GetNodeTransform(aiMatrix4x4 &matrix, const glTF2::Node &node) { |
| 1006 | if (node.matrix.isPresent) { |
| 1007 | CopyValue(node.matrix.value, matrix); |
| 1008 | return; |
| 1009 | } |
| 1010 | |
| 1011 | if (node.translation.isPresent) { |
| 1012 | aiVector3D trans; |
| 1013 | CopyValue(node.translation.value, trans); |
| 1014 | aiMatrix4x4 t; |
| 1015 | aiMatrix4x4::Translation(trans, t); |
| 1016 | matrix = matrix * t; |
| 1017 | } |
| 1018 | |
| 1019 | if (node.rotation.isPresent) { |
| 1020 | aiQuaternion rot; |
| 1021 | CopyValue(node.rotation.value, rot); |
| 1022 | matrix = matrix * aiMatrix4x4(rot.GetMatrix()); |
| 1023 | } |
| 1024 | |
| 1025 | if (node.scale.isPresent) { |
| 1026 | aiVector3D scal(1.f); |
| 1027 | CopyValue(node.scale.value, scal); |
| 1028 | aiMatrix4x4 s; |
| 1029 | aiMatrix4x4::Scaling(scal, s); |
| 1030 | matrix = matrix * s; |
| 1031 | } |
| 1032 | } |
| 1033 | |
| 1034 | static void BuildVertexWeightMapping(Mesh::Primitive &primitive, std::vector<std::vector<aiVertexWeight>> &map, std::vector<unsigned int>* vertexRemappingTablePtr) { |
| 1035 |
no test coverage detected