diff --git a/vcg/space/polygon3.h b/vcg/space/polygon3.h index 3d293eb8..38e57f1e 100644 --- a/vcg/space/polygon3.h +++ b/vcg/space/polygon3.h @@ -534,7 +534,8 @@ typename PolygonType::ScalarType PolyAspectRatio(const PolygonType &F, template typename PolygonType::ScalarType PolygonPointDistance(const PolygonType &F, - const vcg::Point3 &pos) + const vcg::Point3 &pos, + vcg::Point3 &ClosestP) { typedef typename PolygonType::ScalarType ScalarType; typedef typename PolygonType::CoordType CoordType; @@ -549,6 +550,7 @@ typename PolygonType::ScalarType PolygonPointDistance(const PolygonType &F, vcg::TrianglePointDistance(T,pos,dist,closest); if (dist>minD)continue; minD=dist; + ClosestP=closest; } return minD; }