X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fmath%2Fgeometry.cpp;h=58c97ae71e378b98f14ce3cc1917ed8201e23aad;hp=f822ad68e4de3529a14847a6b4d5ab38b5ffeedc;hb=0e061ce526fe46dd3e894223e5d646eb2e30f826;hpb=ee77237c575f255bb04cdae48c89956aa734c811 diff --git a/src/math/geometry.cpp b/src/math/geometry.cpp index f822ad6..58c97ae 100644 --- a/src/math/geometry.cpp +++ b/src/math/geometry.cpp @@ -41,15 +41,15 @@ bool Intersect( glm::dvec3(b_m[0]), glm::dvec3(b_m[1]), glm::dvec3(b_m[2]), - normalize(cross(glm::dvec3(a_m[0]), glm::dvec3(b_m[0]))), - normalize(cross(glm::dvec3(a_m[0]), glm::dvec3(b_m[1]))), - normalize(cross(glm::dvec3(a_m[0]), glm::dvec3(b_m[2]))), - normalize(cross(glm::dvec3(a_m[1]), glm::dvec3(b_m[0]))), - normalize(cross(glm::dvec3(a_m[1]), glm::dvec3(b_m[1]))), - normalize(cross(glm::dvec3(a_m[1]), glm::dvec3(b_m[2]))), - normalize(cross(glm::dvec3(a_m[2]), glm::dvec3(b_m[0]))), - normalize(cross(glm::dvec3(a_m[2]), glm::dvec3(b_m[1]))), - normalize(cross(glm::dvec3(a_m[2]), glm::dvec3(b_m[2]))), + glm::normalize(glm::cross(glm::dvec3(a_m[0]), glm::dvec3(b_m[0]))), + glm::normalize(glm::cross(glm::dvec3(a_m[0]), glm::dvec3(b_m[1]))), + glm::normalize(glm::cross(glm::dvec3(a_m[0]), glm::dvec3(b_m[2]))), + glm::normalize(glm::cross(glm::dvec3(a_m[1]), glm::dvec3(b_m[0]))), + glm::normalize(glm::cross(glm::dvec3(a_m[1]), glm::dvec3(b_m[1]))), + glm::normalize(glm::cross(glm::dvec3(a_m[1]), glm::dvec3(b_m[2]))), + glm::normalize(glm::cross(glm::dvec3(a_m[2]), glm::dvec3(b_m[0]))), + glm::normalize(glm::cross(glm::dvec3(a_m[2]), glm::dvec3(b_m[1]))), + glm::normalize(glm::cross(glm::dvec3(a_m[2]), glm::dvec3(b_m[2]))), }; depth = std::numeric_limits::infinity(); @@ -57,7 +57,7 @@ bool Intersect( int cur_axis = 0; for (const glm::dvec3 &axis : axes) { - if (any(isnan(axis))) { + if (glm::any(glm::isnan(axis))) { // can result from the cross products if A and B have parallel axes ++cur_axis; continue; @@ -65,7 +65,7 @@ bool Intersect( double a_min = std::numeric_limits::infinity(); double a_max = -std::numeric_limits::infinity(); for (const glm::dvec3 &corner : a_corners) { - double val = dot(corner, axis); + double val = glm::dot(corner, axis); a_min = std::min(a_min, val); a_max = std::max(a_max, val); } @@ -73,7 +73,7 @@ bool Intersect( double b_min = std::numeric_limits::infinity(); double b_max = -std::numeric_limits::infinity(); for (const glm::dvec3 &corner : b_corners) { - double val = dot(corner, axis); + double val = glm::dot(corner, axis); b_min = std::min(b_min, val); b_max = std::max(b_max, val); }