line 331 called the correct distance function between segment-point in distance3.h

This commit is contained in:
Nico Pietroni 2010-10-15 15:19:12 +00:00
parent 6d34aec94b
commit 7332494ee2
1 changed files with 6 additions and 3 deletions

View File

@ -63,7 +63,7 @@ created
#include <vcg/math/base.h> #include <vcg/math/base.h>
#include <vcg/space/point3.h> #include <vcg/space/point3.h>
#include <vcg/space/segment3.h> #include <vcg/space/segment3.h>
#include <vcg/space/distance3.h>
namespace vcg { namespace vcg {
namespace face{ namespace face{
@ -325,8 +325,11 @@ namespace vcg {
Box3<ScalarType> bb; Box3<ScalarType> bb;
f.GetBBox(bb); f.GetBBox(bb);
Segment3<ScalarType> degenTri(bb.min,bb.max); Segment3<ScalarType> degenTri(bb.min,bb.max);
Point3<ScalarType> closest= ClosestPoint( degenTri, q ); //Point3<ScalarType> closest= ClosestPoint( degenTri, q );
ScalarType d = Distance(closest, q); //ScalarType d = Distance(closest, q);
Point3<ScalarType> closest;
ScalarType d;
vcg::SegmentPointDistance<ScalarType>(degenTri,q,closest,d);
if( d>dist || d<-dist ) // Risultato peggiore: niente di fatto if( d>dist || d<-dist ) // Risultato peggiore: niente di fatto
return false; return false;
dist=d; dist=d;