Merge branch 'kimkulling/prepare_version_5.2.6_rc1' of https://github.com/assimp/assimp into kimkulling/prepare_version_5.2.6_rc1
commit
61d196bc4b
|
@ -264,12 +264,12 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) {
|
||||||
// We should care only about used vertices, not all of them
|
// We should care only about used vertices, not all of them
|
||||||
// (this can happen due to original file vertices buffer being used by
|
// (this can happen due to original file vertices buffer being used by
|
||||||
// multiple meshes)
|
// multiple meshes)
|
||||||
std::unordered_set<unsigned int> usedVertexIndices;
|
std::vector<bool> usedVertexIndicesMask;
|
||||||
usedVertexIndices.reserve(pMesh->mNumVertices);
|
usedVertexIndicesMask.resize(pMesh->mNumVertices, false);
|
||||||
for (unsigned int a = 0; a < pMesh->mNumFaces; a++) {
|
for (unsigned int a = 0; a < pMesh->mNumFaces; a++) {
|
||||||
aiFace& face = pMesh->mFaces[a];
|
aiFace& face = pMesh->mFaces[a];
|
||||||
for (unsigned int b = 0; b < face.mNumIndices; b++) {
|
for (unsigned int b = 0; b < face.mNumIndices; b++) {
|
||||||
usedVertexIndices.insert(face.mIndices[b]);
|
usedVertexIndicesMask[face.mIndices[b]] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) {
|
||||||
int newIndex = 0;
|
int newIndex = 0;
|
||||||
for( unsigned int a = 0; a < pMesh->mNumVertices; a++) {
|
for( unsigned int a = 0; a < pMesh->mNumVertices; a++) {
|
||||||
// if the vertex is unused Do nothing
|
// if the vertex is unused Do nothing
|
||||||
if (usedVertexIndices.find(a) == usedVertexIndices.end()) {
|
if (!usedVertexIndicesMask[a]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// collect the vertex data
|
// collect the vertex data
|
||||||
|
|
Loading…
Reference in New Issue