Browse Source

Low performance in OptimizeMeshesProcess::ProcessNode with huge number of aiMeshes

Sergio Acereda 8 years ago
parent
commit
8606ec6060
1 changed files with 1 additions and 4 deletions
  1. 1 4
      code/OptimizeMeshes.cpp

+ 1 - 4
code/OptimizeMeshes.cpp

@@ -181,11 +181,8 @@ void OptimizeMeshesProcess::ProcessNode( aiNode* pNode)
                     verts += mScene->mMeshes[am]->mNumVertices;
                     faces += mScene->mMeshes[am]->mNumFaces;
 
+                    pNode->mMeshes[a] = pNode->mMeshes[pNode->mNumMeshes - 1];
                     --pNode->mNumMeshes;
-                    for( unsigned int n = a; n < pNode->mNumMeshes; ++n ) {
-                        pNode->mMeshes[ n ] = pNode->mMeshes[ n + 1 ];
-                    }
-
                     --a;
                 }
             }