diff --git a/primitive/objmodel.cpp b/primitive/objmodel.cpp index 4988ba3..cd805b6 100644 --- a/primitive/objmodel.cpp +++ b/primitive/objmodel.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include "objmodel.h" @@ -68,11 +67,11 @@ void ObjModel::loadObj(const std::string& fileName, Vector3d scale, Vector3d tra } bool ObjModel::intersect(Ray &ray) const { - return std::any_of(this->faces.begin(), - this->faces.end(), - [&ray](auto& face){ + return std::count_if(this->faces.begin(), + this->faces.end(), + [&ray](auto& face){ return face.intersect(ray); - }); + }) > 0; } float ObjModel::minimumBounds(int dimension) const {