From 26b64e424665c387f37119a0a5b561e00476e99f Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Thu, 1 Jun 2006 08:41:26 +0000 Subject: [PATCH] fixed bug in Ray Iterator .. function Init --- vcg/space/index/space_iterators.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vcg/space/index/space_iterators.h b/vcg/space/index/space_iterators.h index 54b2e012..a37e2d95 100644 --- a/vcg/space/index/space_iterators.h +++ b/vcg/space/index/space_iterators.h @@ -137,17 +137,20 @@ namespace vcg{ Elems.clear(); //CoordType ip; //control if intersect the bounding box of the mesh - if(vcg::Intersection_Ray_Box(Si.bbox,r,start)) - { + if (Si.bbox.IsIn(r.Origin())) + start=r.Origin(); + else + if (!(vcg::Intersection_Ray_Box(Si.bbox,r,start))){ + end=true; + return; + } Si.PToIP(start,CurrentCell); _ControlLimits(); _FindLinePar(); //go to first intersection while ((!End())&& Refresh()) _NextCell(); - } - else - end=true; + } bool End()