Skip to content

Commit

Permalink
Fix assimp#5632 by reverting fraction of d6aacef where Collada texcoo…
Browse files Browse the repository at this point in the history
…rds are renumbered to avoid empty slots.
  • Loading branch information
StepanHrbek committed Jun 24, 2024
1 parent c43402c commit 9c4397e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions code/AssetLib/Collada/ColladaLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,14 @@ aiMesh *ColladaLoader::CreateMesh(const ColladaParser &pParser, const Mesh *pSrc
}

// same for texture coords, as many as we have
// empty slots are not allowed, need to pack and adjust UV indexes accordingly
for (size_t a = 0, real = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) {
for (size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) {
if (pSrcMesh->mTexCoords[a].size() >= pStartVertex + numVertices) {
dstMesh->mTextureCoords[real] = new aiVector3D[numVertices];
dstMesh->mTextureCoords[a] = new aiVector3D[numVertices];
for (size_t b = 0; b < numVertices; ++b) {
dstMesh->mTextureCoords[real][b] = pSrcMesh->mTexCoords[a][pStartVertex + b];
dstMesh->mTextureCoords[a][b] = pSrcMesh->mTexCoords[a][pStartVertex + b];
}

dstMesh->mNumUVComponents[real] = pSrcMesh->mNumUVComponents[a];
++real;
dstMesh->mNumUVComponents[a] = pSrcMesh->mNumUVComponents[a];
}
}

Expand Down

0 comments on commit 9c4397e

Please sign in to comment.