Invert logic in build_bone_children_hierarchy.
parent
25ab05eb49
commit
eb3b48e523
|
@ -516,19 +516,19 @@ void HL1MDLLoader::read_bones() {
|
||||||
|
|
||||||
void HL1MDLLoader::build_bone_children_hierarchy(const TempBone &bone)
|
void HL1MDLLoader::build_bone_children_hierarchy(const TempBone &bone)
|
||||||
{
|
{
|
||||||
if (bone.children.size() > 0)
|
if (bone.children.empty())
|
||||||
{
|
return;
|
||||||
aiNode* bone_node = bone.node;
|
|
||||||
bone_node->mNumChildren = static_cast<unsigned int>(bone.children.size());
|
|
||||||
bone_node->mChildren = new aiNode *[bone_node->mNumChildren];
|
|
||||||
|
|
||||||
// Build each child bone's hierarchy recursively.
|
aiNode* bone_node = bone.node;
|
||||||
for (size_t i = 0; i < bone.children.size(); ++i)
|
bone_node->mNumChildren = static_cast<unsigned int>(bone.children.size());
|
||||||
{
|
bone_node->mChildren = new aiNode *[bone_node->mNumChildren];
|
||||||
const TempBone &child_bone = temp_bones_[bone.children[i]];
|
|
||||||
bone_node->mChildren[i] = child_bone.node;
|
// Build each child bone's hierarchy recursively.
|
||||||
build_bone_children_hierarchy(child_bone);
|
for (size_t i = 0; i < bone.children.size(); ++i)
|
||||||
}
|
{
|
||||||
|
const TempBone &child_bone = temp_bones_[bone.children[i]];
|
||||||
|
bone_node->mChildren[i] = child_bone.node;
|
||||||
|
build_bone_children_hierarchy(child_bone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue