Skip to content
Snippets Groups Projects
Unverified Commit c63c8f68 authored by Guilhem Saurel's avatar Guilhem Saurel Committed by GitHub
Browse files

Merge pull request #47 from nim65s/devel

Revert "[OBB] Simplify expression in obbDisjointAndLowerBoundDistance", fix #46
parents f6dd161b 125f67b9
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,6 @@ matrix:
compiler: gcc
- dist: xenial
compiler: gcc
- dist: trusty
compiler: clang
- dist: xenial
compiler: clang
- os: osx
......
......@@ -314,13 +314,18 @@ bool obbDisjointAndLowerBoundDistance (const Matrix3f& B, const Vec3f& T,
// Corner of b axis aligned bounding box the closest to the origin
Vec3f AABB_corner (T.cwiseAbs () - Bf * b);
squaredLowerBoundDistance = (AABB_corner - a).cwiseMax (0).squaredNorm ();
Vec3f diff3 (AABB_corner - a);
diff3 = diff3.cwiseMax (0);
//for (Vec3f::Index i=0; i<3; ++i) diff3 [i] = std::max (0, diff3 [i]);
squaredLowerBoundDistance = diff3.squaredNorm ();
if (squaredLowerBoundDistance > breakDistance2)
return true;
AABB_corner = (B.transpose () * T).cwiseAbs () - Bf.transpose () * a;
// | B^T T| - b - Bf^T a
squaredLowerBoundDistance = (AABB_corner - b).cwiseMax (0).squaredNorm ();
// diff3 = | B^T T| - b - Bf^T a
diff3 = AABB_corner - b;
diff3 = diff3.cwiseMax (0);
squaredLowerBoundDistance = diff3.squaredNorm ();
if (squaredLowerBoundDistance > breakDistance2)
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment