Explorar el Código

fix regression in join vertices post process.

sunjc hace 2 años
padre
commit
647f1e47fa
Se han modificado 1 ficheros con 3 adiciones y 11 borrados
  1. 3 11
      code/PostProcessing/JoinVerticesProcess.cpp

+ 3 - 11
code/PostProcessing/JoinVerticesProcess.cpp

@@ -357,7 +357,8 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) {
             }
         } else{
             // if the vertex is already there just find the replace index that is appropriate to it
-            replaceIndex[a] = it->second;
+			// mark it with '0x80000000'
+            replaceIndex[a] = it->second | 0x80000000;
         }
     }
 
@@ -400,17 +401,8 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) {
             for ( unsigned int b = 0; b < bone->mNumWeights; b++ ) {
                 const aiVertexWeight& ow = bone->mWeights[ b ];
                 // if the vertex is a unique one, translate it
+				// filter out joined vertices by mrak.
                 if ( !( replaceIndex[ ow.mVertexId ] & 0x80000000 ) ) {
-                    bool weightAlreadyExists = false;
-                    for (std::vector<aiVertexWeight>::iterator vit = newWeights.begin(); vit != newWeights.end(); ++vit) {
-                        if (vit->mVertexId == replaceIndex[ow.mVertexId]) {
-                            weightAlreadyExists = true;
-                            break;
-                        }
-                    }
-                    if (weightAlreadyExists) {
-                        continue;
-                    }
                     aiVertexWeight nw;
                     nw.mVertexId = replaceIndex[ ow.mVertexId ];
                     nw.mWeight = ow.mWeight;