Skip to content

Commit

Permalink
Merge branch 'gz-common6' into fix_gltf_lightmap
Browse files Browse the repository at this point in the history
  • Loading branch information
iche033 committed Sep 5, 2024
2 parents 29b17f1 + 3f129c3 commit 2939081
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions graphics/src/AssimpLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,14 +680,14 @@ SubMesh AssimpLoader::Implementation::CreateSubMesh(
subMesh.AddVertex(vertex);
subMesh.AddNormal(normal);
// Iterate over sets of texture coordinates
int uvIdx = 0;
while(_assimpMesh->HasTextureCoords(uvIdx))
for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i)
{
if (!_assimpMesh->HasTextureCoords(i))
continue;
math::Vector3d texcoords;
texcoords.X(_assimpMesh->mTextureCoords[uvIdx][vertexIdx].x);
texcoords.Y(_assimpMesh->mTextureCoords[uvIdx][vertexIdx].y);
subMesh.AddTexCoordBySet(texcoords.X(), texcoords.Y(), uvIdx);
++uvIdx;
texcoords.X(_assimpMesh->mTextureCoords[i][vertexIdx].x);
texcoords.Y(_assimpMesh->mTextureCoords[i][vertexIdx].y);
subMesh.AddTexCoordBySet(texcoords.X(), texcoords.Y(), i);
}
}
for (unsigned faceIdx = 0; faceIdx < _assimpMesh->mNumFaces; ++faceIdx)
Expand Down

0 comments on commit 2939081

Please sign in to comment.