Procházet zdrojové kódy

Merge pull request #854 from tomacd/fix_scene_combiner

fix SceneCombiner copy of aiNode not setting mParent field
Alexander Gessler před 9 roky
rodič
revize
e7fd168114
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  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
     // and reallocate all arrays
     GetArrayCopy( dest->mMeshes, dest->mNumMeshes );
     GetArrayCopy( dest->mMeshes, dest->mNumMeshes );
     CopyPtrArray( dest->mChildren, src->mChildren,dest->mNumChildren);
     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;
+	}
 }
 }
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------