mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +02:00
Let's try that again.
This commit is contained in:
parent
0c8b3eaf1a
commit
3e8b5c8714
1 changed files with 8 additions and 8 deletions
|
@ -705,17 +705,17 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index) {
|
|||
if (vertexIndex < 0) {
|
||||
vertexIndex = -vertexIndex - 1;
|
||||
}
|
||||
vertexIndex = qMin(vertexIndex, data.vertices.size() - 1);
|
||||
|
||||
Vertex vertex;
|
||||
vertex.originalIndex = vertexIndex;
|
||||
|
||||
glm::vec3 normal;
|
||||
if (data.normalIndices.isEmpty()) {
|
||||
normal = data.normals.at(data.normalsByVertex ? vertexIndex : index);
|
||||
|
||||
} else {
|
||||
int normalIndex = data.normalIndices.at(data.normalsByVertex ? vertexIndex : index);
|
||||
int normalIndex = data.normalsByVertex ? vertexIndex : index;
|
||||
if (data.normalIndices.isEmpty()) {
|
||||
if (normalIndex < data.normals.size()) {
|
||||
normal = data.normals.at(normalIndex);
|
||||
}
|
||||
} else if (normalIndex < data.normalIndices.size()) {
|
||||
normalIndex = data.normalIndices.at(normalIndex);
|
||||
if (normalIndex >= 0 && normalIndex < data.normals.size()) {
|
||||
normal = data.normals.at(normalIndex);
|
||||
}
|
||||
|
@ -725,7 +725,7 @@ void appendIndex(MeshData& data, QVector<int>& indices, int index) {
|
|||
if (index < data.texCoords.size()) {
|
||||
vertex.texCoord = data.texCoords.at(index);
|
||||
}
|
||||
} else {
|
||||
} else if (index < data.texCoordIndices.size()) {
|
||||
int texCoordIndex = data.texCoordIndices.at(index);
|
||||
if (texCoordIndex >= 0 && texCoordIndex < data.texCoords.size()) {
|
||||
vertex.texCoord = data.texCoords.at(texCoordIndex);
|
||||
|
|
Loading…
Reference in a new issue