pub fn clip_aabb_line(
aabb: &Aabb,
origin: &Point<f32>,
dir: &Vector<f32>,
) -> Option<((f32, Vector<f32>, isize), (f32, Vector<f32>, isize))>Expand description
Computes the segment given by the intersection of a line and an Aabb.
Returns the two intersections represented as (t, normal, side) such that:
origin + dir * tgives the intersection points.normalis the face normal at the intersection. This is equal to the zero vector ifdiris invalid (a zero vector or NaN) andoriginis inside the AABB.sideis the side of the AABB that was hit. This is an integer in [-3, 3] where1represents the+Xaxis,2the+Yaxis, etc., and negative values represent the corresponding negative axis. The special value of0indicates that the provideddiris zero orNaNand the line origin is inside the AABB.