diff --git a/src/collision/TriangleVertexArray.cpp b/src/collision/TriangleVertexArray.cpp index ad59d37a..1e500001 100644 --- a/src/collision/TriangleVertexArray.cpp +++ b/src/collision/TriangleVertexArray.cpp @@ -163,9 +163,9 @@ void TriangleVertexArray::computeVerticesNormals() { Vector3 normalComponent = std::asin(sinA) * crossProduct; // Add the normal component of this vertex into the normals array - verticesNormals[verticesIndices[v]] = normalComponent.x; - verticesNormals[verticesIndices[v] + 1] = normalComponent.y; - verticesNormals[verticesIndices[v] + 2] = normalComponent.z; + verticesNormals[verticesIndices[v] * 3] = normalComponent.x; + verticesNormals[verticesIndices[v] * 3 + 1] = normalComponent.y; + verticesNormals[verticesIndices[v] * 3 + 2] = normalComponent.z; } } @@ -173,12 +173,12 @@ void TriangleVertexArray::computeVerticesNormals() { for (uint v=0; v(verticesNormals);