X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgeometry%2Fgeometry.cpp;h=6ff26cad40b928b761a62630f9538d467c3c6348;hb=c2bf905f4b9863fe0f5c876ed00fe298cb95ab6b;hp=5db29c8c3ad8488ccb655f3d71b15bcae7c2942c;hpb=292a23aab0c4d837cb69aafde45a4d0cab980782;p=blank.git diff --git a/src/geometry/geometry.cpp b/src/geometry/geometry.cpp index 5db29c8..6ff26ca 100644 --- a/src/geometry/geometry.cpp +++ b/src/geometry/geometry.cpp @@ -109,14 +109,14 @@ bool Intersection( glm::vec3 min_all(glm::min(t1, t2)); if (min_all.x > min_all.y) { if (min_all.x > min_all.z) { - normal->x = t2.x < t1.x ? 1 : -1; + *normal = glm::vec3(t2.x < t1.x ? 1 : -1, 0, 0); } else { - normal->z = t2.z < t1.z ? 1 : -1; + *normal = glm::vec3(0, 0, t2.z < t1.z ? 1 : -1); } } else if (min_all.y > min_all.z) { - normal->y = t2.y < t1.y ? 1 : -1; + *normal = glm::vec3(0, t2.y < t1.y ? 1 : -1, 0); } else { - normal->z = t2.z < t1.z ? 1 : -1; + *normal = glm::vec3(0, 0, t2.z < t1.z ? 1 : -1); } } return true;