Skip to content
Snippets Groups Projects
Commit fdbd4a13 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[App/U] Vector operations for min/max and compare.

parent 6912260c
No related branches found
No related tags found
No related merge requests found
......@@ -54,17 +54,8 @@ bool testTriangleIntersectingAABB(MeshLib::Node const& n0,
Eigen::Vector3d(n2.getCoords()) - c;
// Test the three axes corresponding to the face normals of AABB b
Eigen::Vector3d const min_coeff = v.rowwise().minCoeff();
Eigen::Vector3d const max_coeff = v.rowwise().maxCoeff();
if (max_coeff.x() < -e.x() || min_coeff.x() > e.x())
{
return false;
}
if (max_coeff.y() < -e.y() || min_coeff.y() > e.y())
{
return false;
}
if (max_coeff.z() < -e.z() || min_coeff.z() > e.z())
if (((v.rowwise().minCoeff() - e).array() > 0).any() ||
((v.rowwise().maxCoeff() + e).array() < 0).any())
{
return false;
}
......
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