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

Method ExportNode

code/AssetLib/glTF/glTFExporter.cpp:857–878  ·  view source on GitHub ↗

* Export node and recursively calls ExportNode for all children. * Since these nodes are not the root node, we also export the parent Ref */

Source from the content-addressed store, hash-verified

855 * Since these nodes are not the root node, we also export the parent Ref<Node>
856 */
857unsigned int glTFExporter::ExportNode(const aiNode* n, Ref<Node>& parent)
858{
859 Ref<Node> node = mAsset->nodes.Create(mAsset->FindUniqueID(n->mName.C_Str(), "node"));
860
861 node->parent = parent;
862
863 if (!n->mTransformation.IsIdentity(configEpsilon)) {
864 node->matrix.isPresent = true;
865 CopyValue(n->mTransformation, node->matrix.value);
866 }
867
868 for (unsigned int i = 0; i < n->mNumMeshes; ++i) {
869 node->meshes.push_back(mAsset->meshes.Get(n->mMeshes[i]));
870 }
871
872 for (unsigned int i = 0; i < n->mNumChildren; ++i) {
873 unsigned int idx = ExportNode(n->mChildren[i], node);
874 node->children.push_back(mAsset->nodes.Get(idx));
875 }
876
877 return node.GetIndex();
878}
879
880
881void glTFExporter::ExportScene()

Callers

nothing calls this directly

Calls 6

C_StrMethod · 0.80
GetIndexMethod · 0.80
CopyValueFunction · 0.70
CreateMethod · 0.45
push_backMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected