pub fn intersect_with(&self, aabb: AABB) -> impl Iterator<Item = Intersection> {
        let mins = aabb.mins.map(|t| (t.floor() as i32).saturating_sub(1));
        let maxs = aabb.maxs.map(|t| (t.ceil() as i32).saturating_add(1));

        self.shapes
            .get_layers_in_range(mins.z..maxs.z)
            .flat_map(move |(z, layer)| {
                let coords = (mins.y..maxs.y)
                    .flat_map(move |y| (mins.x..maxs.x).map(move |x| Vector3::new(x, y, z)));
                coords.filter_map(move |coords| {
                    layer
                        .get(coords.xy())
                        .map(move |shape| Intersection { coords, shape })
                })
            })
    }
/// Find possible intersections with an AABB.
Find possible intersections with an AABB.
Find possible intersections with an AABB .
pub fn intersect_with(&self, aabb: AABB) -> impl Iterator<Item = Intersection> {
        let mins = aabb.mins.map(|t| (t.floor() as i32).saturating_sub(1));
        let maxs = aabb.maxs.map(|t| (t.ceil() as i32).saturating_add(1));
        self.shapes
            .get_layers_in_range(mins.z..maxs.z)
            .flat_map(move |(z, layer)| {
                let coords = (mins.y..maxs.y)
                    .flat_map(move |y| (mins.x..maxs.x).map(move |x| Vector3::new(x, y, z)));
                coords.filter_map(move |coords| {
                    layer
                        .get(coords.xy())
                        .map(move |shape| Intersection { coords, shape })
                })
            })
    }
pub fn intersect_with ( & self , aabb : AABB ) -> impl Iterator < Item = Intersection > { let mins = aabb . mins . map ( | t | ( t . floor ( ) as i32 ) . saturating_sub ( 1 ) ) ; let maxs = aabb . maxs . map ( | t | ( t . ceil ( ) as i32 ) . saturating_add ( 1 ) ) ; self . shapes . get_layers_in_range ( mins . z .. maxs . z ) . flat_map ( move | ( z , layer ) | { let coords = ( mins . y .. maxs . y ) . flat_map ( move | y | ( mins . x .. maxs . x ) . map ( move | x | Vector3 :: new ( x , y , z ) ) ) ; coords . filter_map ( move | coords | { layer . get ( coords . xy ( ) ) . map ( move | shape | Intersection { coords , shape } ) } ) } ) }
Find possible intersections with an AABB.
Find possible intersections with an AABB .
&self
aabb
AABB
&self
aabb
AABB