fix regression in join vertices post process.
parent
487c03f547
commit
647f1e47fa
|
@ -357,7 +357,8 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) {
|
||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
// if the vertex is already there just find the replace index that is appropriate to it
|
// 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++ ) {
|
for ( unsigned int b = 0; b < bone->mNumWeights; b++ ) {
|
||||||
const aiVertexWeight& ow = bone->mWeights[ b ];
|
const aiVertexWeight& ow = bone->mWeights[ b ];
|
||||||
// if the vertex is a unique one, translate it
|
// if the vertex is a unique one, translate it
|
||||||
|
// filter out joined vertices by mrak.
|
||||||
if ( !( replaceIndex[ ow.mVertexId ] & 0x80000000 ) ) {
|
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;
|
aiVertexWeight nw;
|
||||||
nw.mVertexId = replaceIndex[ ow.mVertexId ];
|
nw.mVertexId = replaceIndex[ ow.mVertexId ];
|
||||||
nw.mWeight = ow.mWeight;
|
nw.mWeight = ow.mWeight;
|
||||||
|
|
Loading…
Reference in New Issue