recursion WIP

This commit is contained in:
Xiao Qi 2022-11-11 17:54:50 +08:00
parent 7777e5642b
commit f673036e4e
2 changed files with 7 additions and 10 deletions

View File

@ -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<aiNode const*> 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

View File

@ -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;
};