|
@@ -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;
|