浏览代码

fix SceneCombiner copy of aiNode not setting mParent field

tomacd 9 年之前
父节点
当前提交
5a8c15d826
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      code/SceneCombiner.cpp

+ 5 - 0
code/SceneCombiner.cpp

@@ -1211,6 +1211,11 @@ void SceneCombiner::Copy     (aiNode** _dest, const aiNode* src)
     // and reallocate all arrays
     GetArrayCopy( dest->mMeshes, dest->mNumMeshes );
     CopyPtrArray( dest->mChildren, src->mChildren,dest->mNumChildren);
+
+	// need to set the mParent fields to the created aiNode.
+	for( unsigned int i = 0; i < dest->mNumChildren; i ++ ) {
+		dest->mChildren[i]->mParent = dest;
+	}
 }
 
 // ------------------------------------------------------------------------------------------------