pub(crate) fn aab_raycast(
    aab: Aab,
    origin_ray: Ray,
    reversed: bool,
) -> impl Iterator<Item = (RaycastStep, Aab)> {
    let (leading_corner, trailing_box) = aab.leading_corner_trailing_box(if reversed {
        -origin_ray.direction
    } else {
        origin_ray.direction
    });
    let leading_ray = origin_ray.translate(leading_corner);
    leading_ray.cast().map(move |step| {
        // TODO: The POSITION_EPSILON is a quick kludge to get a result that
        // *includes* the cubes we are advancing towards. Replace it with something
        // more precisely what we need.
        let nudge = if step.face() != Face::Within {
            origin_ray.direction * POSITION_EPSILON
        } else {
            Vector3::zero()
        };
        (
            step,
            trailing_box.translate((step.intersection_point(leading_ray) + nudge).to_vec()),
        )
    })
}
/// Given a ray describing movement of the origin of an AAB, perform a raycast to find
/// the positions where the AAB moves into new cubes.
///
/// If `reversed` is true, find positions where it leaves cubes.
Given a ray describing movement of the origin of an AAB, perform a raycast to find
the positions where the AAB moves into new cubes.

If `reversed` is true, find positions where it leaves cubes.
Given a ray describing movement of the origin of an AAB perform a raycast to find the positions where the AAB moves into new cubes . If ` reversed ` is true find positions where it leaves cubes .
pub(crate) fn aab_raycast(
    aab: Aab,
    origin_ray: Ray,
    reversed: bool,
) -> impl Iterator<Item = (RaycastStep, Aab)> {
    let (leading_corner, trailing_box) = aab.leading_corner_trailing_box(if reversed {
        -origin_ray.direction
    } else {
        origin_ray.direction
    });
    let leading_ray = origin_ray.translate(leading_corner);
    leading_ray.cast().map(move |step| {
        // TODO: The POSITION_EPSILON is a quick kludge to get a result that
        // *includes* the cubes we are advancing towards. Replace it with something
        // more precisely what we need.
        let nudge = if step.face() != Face::Within {
            origin_ray.direction * POSITION_EPSILON
        } else {
            Vector3::zero()
        };
        (
            step,
            trailing_box.translate((step.intersection_point(leading_ray) + nudge).to_vec()),
        )
    })
}
pub ( crate ) fn aab_raycast ( aab : Aab , origin_ray : Ray , reversed : bool , ) -> impl Iterator < Item = ( RaycastStep , Aab ) > { let ( leading_corner , trailing_box ) = aab . leading_corner_trailing_box ( if reversed { - origin_ray . direction } else { origin_ray . direction } ) ; let leading_ray = origin_ray . translate ( leading_corner ) ; leading_ray . cast ( ) . map ( move | step | { // TODO: The POSITION_EPSILON is a quick kludge to get a result that // *includes* the cubes we are advancing towards. Replace it with something // more precisely what we need. let nudge = if step . face ( ) != Face :: Within { origin_ray . direction * POSITION_EPSILON } else { Vector3 :: zero ( ) } ; ( step , trailing_box . translate ( ( step . intersection_point ( leading_ray ) + nudge ) . to_vec ( ) ) , ) } ) }
Given a ray describing movement of the origin of an AAB, perform a raycast to find
the positions where the AAB moves into new cubes.
Given a ray describing movement of the origin of an AAB perform a raycast to find the positions where the AAB moves into new cubes .
aab
Aab
origin_ray
Ray
reversed
bool