From 8606ec6060e599fac72cb17ff21f626665c53af3 Mon Sep 17 00:00:00 2001 From: Sergio Acereda Date: Sat, 22 Jul 2017 23:28:55 +0200 Subject: [PATCH] Low performance in OptimizeMeshesProcess::ProcessNode with huge number of aiMeshes --- code/OptimizeMeshes.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/OptimizeMeshes.cpp b/code/OptimizeMeshes.cpp index 65a3cadce..f8183fc75 100644 --- a/code/OptimizeMeshes.cpp +++ b/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; } }