Use correct indexes when checking mesh normals

This commit is contained in:
Dmitry Kostenko 2022-01-01 02:06:48 +01:00 committed by x2048
parent a684a91bf5
commit e4583cb9b7

@ -356,7 +356,7 @@ bool checkMeshNormals(scene::IMesh *mesh)
buffer->getPosition(buffer->getIndices()[i+2]));
for (u16 j = 0; j < 3; j++)
if (plane.Normal.dotProduct(buffer->getNormal(buffer->getIndices()[j])) < 0)
if (plane.Normal.dotProduct(buffer->getNormal(buffer->getIndices()[i+j])) <= 0)
return false;
}