diff --git a/sfw/core/aabb.cpp b/sfw/core/aabb.cpp index afe7e71..d0de91e 100644 --- a/sfw/core/aabb.cpp +++ b/sfw/core/aabb.cpp @@ -117,8 +117,9 @@ AABB AABB::intersection(const AABB &p_aabb) const { bool AABB::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip, Vector3 *r_normal) const { Vector3 c1, c2; Vector3 end = position + size; - real_t near = -1e20; - real_t far = 1e20; + // has a far and near macro defined, and we can't undo it here in the amalgamation + real_t aabb_near = -1e20; + real_t aabb_far = 1e20; int axis = 0; for (int i = 0; i < 3; i++) { @@ -133,14 +134,14 @@ bool AABB::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 * if (c1[i] > c2[i]) { SWAP(c1, c2); } - if (c1[i] > near) { - near = c1[i]; + if (c1[i] > aabb_near) { + aabb_near = c1[i]; axis = i; } - if (c2[i] < far) { - far = c2[i]; + if (c2[i] < aabb_far) { + aabb_far = c2[i]; } - if ((near > far) || (far < 0)) { + if ((aabb_near > aabb_far) || (aabb_far < 0)) { return false; } } diff --git a/tools/merger/sfw_full.cpp.inl b/tools/merger/sfw_full.cpp.inl index ad72859..71afab8 100644 --- a/tools/merger/sfw_full.cpp.inl +++ b/tools/merger/sfw_full.cpp.inl @@ -56,13 +56,6 @@ #undef ONLY_GLAD #include "sfw_3rd.m" -#if defined(_WIN64) || defined(_WIN32) -#undef far -#undef near -#undef FAR -#undef NEAR -#endif - #undef CursorShape #if defined(__linux__)