Use the original algorithm

This commit is contained in:
Philipp Möller 2015-11-20 12:13:26 +01:00 committed by Sébastien Loriot
parent b086fc6ec6
commit ce6501a291
1 changed files with 15 additions and 9 deletions

View File

@ -141,19 +141,25 @@ struct AABB_traits_base_2<GeomTraits,true>{
FT t1 = (bbox.min(i) - *source_iter) / *direction_iter;
FT t2 = (bbox.max(i) - *source_iter) / *direction_iter;
t_near = (std::max)(t_near, (std::min)(t1, t2));
t_far = (std::min)(t_far, (std::max)(t1, t2));
if(t1 > t2)
std::swap(t1, t2);
if(t1 > t_near)
t_near = t1;
if(t2 < t_far)
t_far = t2;
if(t_near > t_far)
return boost::none;
if(t_far < 0)
return boost::none;
}
}
if(t_far > t_near && t_far > 0) {
if(t_near < FT(0.))
return FT(0.);
else
return t_near;
if(t_far > t_near && t_far > FT(0.)) {
if(t_near < FT(0.))
return FT(0.);
else
return t_near;
} else {
return boost::none;
}
}