Removed warning. Changed a surely verified if condition into an assert.
(chosing the min between 3 elems we had a if-else chain where the last if was useless unless you have NAN )
This commit is contained in:
parent
1c1e3f778a
commit
a29df708da
|
@ -350,7 +350,7 @@ namespace vcg {
|
||||||
ScalarType bt;
|
ScalarType bt;
|
||||||
if(b==b0) bt = PSDist(q,f.cV(1)->cP(),f.cV(2)->cP(),p);
|
if(b==b0) bt = PSDist(q,f.cV(1)->cP(),f.cV(2)->cP(),p);
|
||||||
else if(b==b1) bt = PSDist(q,f.cV(2)->cP(),f.cV(0)->cP(),p);
|
else if(b==b1) bt = PSDist(q,f.cV(2)->cP(),f.cV(0)->cP(),p);
|
||||||
else if(b==b2) bt = PSDist(q,f.cV(0)->cP(),f.cV(1)->cP(),p);
|
else {assert(b==b2); bt = PSDist(q,f.cV(0)->cP(),f.cV(1)->cP(),p);}
|
||||||
//printf("Warning area:%g %g %g %g thr:%g bt:%g\n",Area(), b0,b1,b2,EPSILON*Area(),bt);
|
//printf("Warning area:%g %g %g %g thr:%g bt:%g\n",Area(), b0,b1,b2,EPSILON*Area(),bt);
|
||||||
if(dist>bt) { dist = bt; return true; }
|
if(dist>bt) { dist = bt; return true; }
|
||||||
else return false;
|
else return false;
|
||||||
|
@ -387,7 +387,7 @@ namespace vcg {
|
||||||
ScalarType bt;
|
ScalarType bt;
|
||||||
if(b==b0) bt = PSDist(q,f.cV(1)->cP(),f.cV(2)->cP(),p);
|
if(b==b0) bt = PSDist(q,f.cV(1)->cP(),f.cV(2)->cP(),p);
|
||||||
else if(b==b1) bt = PSDist(q,f.cV(2)->cP(),f.cV(0)->cP(),p);
|
else if(b==b1) bt = PSDist(q,f.cV(2)->cP(),f.cV(0)->cP(),p);
|
||||||
else if(b==b2) bt = PSDist(q,f.cV(0)->cP(),f.cV(1)->cP(),p);
|
else{ assert(b==b2); bt = PSDist(q,f.cV(0)->cP(),f.cV(1)->cP(),p);}
|
||||||
//printf("Warning area:%g %g %g %g thr:%g bt:%g\n",Area(), b0,b1,b2,EPSILON*Area(),bt);
|
//printf("Warning area:%g %g %g %g thr:%g bt:%g\n",Area(), b0,b1,b2,EPSILON*Area(),bt);
|
||||||
if(dist>bt) { dist = bt; return true; }
|
if(dist>bt) { dist = bt; return true; }
|
||||||
else return false;
|
else return false;
|
||||||
|
@ -424,7 +424,7 @@ namespace vcg {
|
||||||
ScalarType bt;
|
ScalarType bt;
|
||||||
if(b==b0) bt = PSDist(q,f.cV(1)->cP(),f.cV(2)->cP(),p);
|
if(b==b0) bt = PSDist(q,f.cV(1)->cP(),f.cV(2)->cP(),p);
|
||||||
else if(b==b1) bt = PSDist(q,f.cV(2)->cP(),f.cV(0)->cP(),p);
|
else if(b==b1) bt = PSDist(q,f.cV(2)->cP(),f.cV(0)->cP(),p);
|
||||||
else if(b==b2) bt = PSDist(q,f.cV(0)->cP(),f.cV(1)->cP(),p);
|
else { assert(b==b2); bt = PSDist(q,f.cV(0)->cP(),f.cV(1)->cP(),p); }
|
||||||
//printf("Warning area:%g %g %g %g thr:%g bt:%g\n",Area(), b0,b1,b2,EPSILON*Area(),bt);
|
//printf("Warning area:%g %g %g %g thr:%g bt:%g\n",Area(), b0,b1,b2,EPSILON*Area(),bt);
|
||||||
|
|
||||||
if(dist>bt) { dist = bt; return true; }
|
if(dist>bt) { dist = bt; return true; }
|
||||||
|
|
Loading…
Reference in New Issue