From 56fe9a828ba0c12391cc0d9b43b4caa1bb95ea5b Mon Sep 17 00:00:00 2001 From: cignoni Date: Mon, 13 Sep 2010 09:35:24 +0000 Subject: [PATCH] BUG! In IntersectionRayMesh the IntersectionLineTriangle had a parameter swapped... Thanks to Bo Jiang & Meng Luan for the kind bug submission --- vcg/complex/intersection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcg/complex/intersection.h b/vcg/complex/intersection.h index 4c2ce3f0..c3982a0a 100644 --- a/vcg/complex/intersection.h +++ b/vcg/complex/intersection.h @@ -271,7 +271,7 @@ bool IntersectionRayMesh( p1=vcg::Point3( (*fi).P(0).X() ,(*fi).P(0).Y(),(*fi).P(0).Z() ); p2=vcg::Point3( (*fi).P(1).X() ,(*fi).P(1).Y(),(*fi).P(1).Z() ); p3=vcg::Point3( (*fi).P(2).X() ,(*fi).P(2).Y(),(*fi).P(2).Z() ); - if(IntersectionLineTriangle(ray,p1,p2,p3,bar1,bar2,dist)) + if(IntersectionLineTriangle(ray,p1,p2,p3,dist,bar1,bar2)) { hitPoint= p1*(1-bar1-bar2) + p2*bar1 + p3*bar2; hit=true; @@ -314,7 +314,7 @@ bool IntersectionRayMesh( p1=vcg::Point3( (*fi).P(0).X() ,(*fi).P(0).Y(),(*fi).P(0).Z() ); p2=vcg::Point3( (*fi).P(1).X() ,(*fi).P(1).Y(),(*fi).P(1).Z() ); p3=vcg::Point3( (*fi).P(2).X() ,(*fi).P(2).Y(),(*fi).P(2).Z() ); - if(IntersectionLineTriangle(ray,p1,p2,p3,bar1,bar2,dist)) + if(IntersectionLineTriangle(ray,p1,p2,p3,dist,bar1,bar2)) { bar3 = (1-bar1-bar2); hitPoint= p1*bar3 + p2*bar1 + p3*bar2;