diff --git a/vcg/space/box3.h b/vcg/space/box3.h index 93fa769d..5709b72e 100644 --- a/vcg/space/box3.h +++ b/vcg/space/box3.h @@ -377,35 +377,6 @@ template Box3 Point3::GetBBox(Box3 &bb) const { } -template -ScalarType DistancePoint3Box3(const Point3 &p, - const Box3 &b) -{ - ///if fall inside return distance to a face - 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()); - const ScalarType dz = std::min(b.max.Z()-p.Z(), p.Z()-b.min.Z()); - - return std::min(dx, std::min(dy, dz)); - } - - { - ScalarType sq_dist = ScalarType(0); - for (int i=0; i<3; ++i) - { - ScalarType delta = ScalarType(0); - if (p[i] < b.min[i]) delta = p[i] - b.min[i]; - else if (p[i] > b.max[i]) delta = p[i] - b.max[i]; - sq_dist += delta * delta; - } - - return math::Sqrt(sq_dist); - } -} - - typedef Box3 Box3s; typedef Box3 Box3i; typedef Box3 Box3f;