recursion WIP
This commit is contained in:
parent
7777e5642b
commit
f673036e4e
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue