MCPcopy Create free account
hub / github.com/assimp/assimp / GetNodeTransform

Function GetNodeTransform

code/AssetLib/glTF2/glTF2Importer.cpp:1005–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1003}
1004
1005static 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
1034static void BuildVertexWeightMapping(Mesh::Primitive &primitive, std::vector<std::vector<aiVertexWeight>> &map, std::vector<unsigned int>* vertexRemappingTablePtr) {
1035

Callers 3

ImportNodeMethod · 0.85
WriteCameraMethod · 0.85
WriteLightsMethod · 0.85

Calls 4

TranslationClass · 0.85
aiMatrix4x4Class · 0.85
GetMatrixMethod · 0.80
CopyValueFunction · 0.70

Tested by

no test coverage detected