Loading src/tools/liang_barsky.h +11 −9 Original line number Diff line number Diff line Loading @@ -84,8 +84,11 @@ namespace allpix { auto intersect = LiangBarskyIntersectionDistances(direction, position, box); if(!intersect) { return std::nullopt; } // The intersection is a point P + t * D. Return closest impact point if positive (i.e. in direction of the motion) if(intersect) { auto [t0, t1] = intersect.value(); if(t0 > 0 && t1 > 0) { return (position + std::min(t0, t1) * direction); Loading @@ -94,7 +97,6 @@ namespace allpix { } else if(t1 > 0) { return (position + t1 * direction); } } // Otherwise: The line does not intersect the box. return std::nullopt; Loading Loading
src/tools/liang_barsky.h +11 −9 Original line number Diff line number Diff line Loading @@ -84,8 +84,11 @@ namespace allpix { auto intersect = LiangBarskyIntersectionDistances(direction, position, box); if(!intersect) { return std::nullopt; } // The intersection is a point P + t * D. Return closest impact point if positive (i.e. in direction of the motion) if(intersect) { auto [t0, t1] = intersect.value(); if(t0 > 0 && t1 > 0) { return (position + std::min(t0, t1) * direction); Loading @@ -94,7 +97,6 @@ namespace allpix { } else if(t1 > 0) { return (position + t1 * direction); } } // Otherwise: The line does not intersect the box. return std::nullopt; Loading