diff --git a/src/Libraries/MeshCompiler.cpp b/src/Libraries/MeshCompiler.cpp index 935d5e0..d61c434 100644 --- a/src/Libraries/MeshCompiler.cpp +++ b/src/Libraries/MeshCompiler.cpp @@ -241,20 +241,16 @@ namespace SH_COMP file.close(); } - void MeshCompiler::BuildArmature(aiNode const* node, RigNode*& root) noexcept + void MeshCompiler::BuildArmature(aiNode const& baseNode, RigNode*& root) noexcept { std::queue nodes; - nodes.push(node); + nodes.push(&baseNode); + root = new RigNode(); + RigNode* parent = nullptr; auto current = root; - while(!nodes.empty()) - { - auto node = nodes.front(); - nodes.pop(); - - current->name = node->mName.C_Str(); - } + //TODO Use CopyNode de recursive copy } void MeshCompiler::LoadAndCompile(AssetPath path) noexcept diff --git a/src/Libraries/MeshCompiler.h b/src/Libraries/MeshCompiler.h index 28eac51..cf72b5f 100644 --- a/src/Libraries/MeshCompiler.h +++ b/src/Libraries/MeshCompiler.h @@ -41,7 +41,8 @@ namespace SH_COMP static void LoadFromFile(AssetPath path, MeshAsset& asset) noexcept; static void CompileMeshBinary(AssetPath path, MeshAsset const& asset) noexcept; - static void BuildArmature(aiNode const* node, RigNode*& root) noexcept; + static void BuildArmature(aiNode const& node, RigNode*& root) noexcept; + static void CopyNode(aiNode const& source, RigNode*& parent) noexcept; public: static void LoadAndCompile(AssetPath path) noexcept; };