diff --git a/vcg/space/box3.h b/vcg/space/box3.h index fd1765e1..62bd4fcc 100644 --- a/vcg/space/box3.h +++ b/vcg/space/box3.h @@ -382,7 +382,7 @@ ScalarType DistancePoint3Box3(const Point3 &p, const Box3 &b) { ///if fall inside return distance to a face - if (bbox.IsIn(test)) + if (b.IsIn(p)) { const ScalarType dx = std::min(b.max.X()-p.X(), p.X()-b.min.X()); const ScalarType dy = std::min(b.max.Y()-p.Y(), p.Y()-b.min.Y());