Commit afa4fff1 authored by Janis Born's avatar Janis Born

prevent glm assertion failing when normalizing normals in loadGeometryDataFromOBJ

parent 09a70459
......@@ -307,7 +307,9 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
glm::vec3 v0 = (glm::vec3)positionData[indices[3 * triangleIndex + 0].position];
glm::vec3 v1 = (glm::vec3)positionData[indices[3 * triangleIndex + 1].position];
glm::vec3 v2 = (glm::vec3)positionData[indices[3 * triangleIndex + 2].position];
glm::vec3 normal = glm::normalize(glm::cross(v1 - v0, v2 - v0));
glm::vec3 normal = glm::cross(v1 - v0, v2 - v0);
if (normal != glm::vec3(0))
normal = glm::normalize(normal);
abData[pos++] = normal.x;
abData[pos++] = normal.y;
abData[pos++] = normal.z;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment