/// Converts a world position to a tile index.
///
/// The "position" of a tile is it's bottom left corner. Returns None if the position is out of bounds.
Converts a world position to a tile index.
The "position" of a tile is it's bottom left corner. Returns None if the position is out of bounds.
Converts a world position to a tile index . The " position " of a tile is it ' s bottom left corner . Returns None if the position is out of bounds .
pub fn world_to_tile(&self, transform: &GlobalTransform, world_pos: Vec3) -> Option<IVec2> {
        let tile_pos = self.world_to_tile_unchecked(transform, world_pos);
        if !self.tile_in_bounds(tile_pos) {
            return None;
        }
        Some(tile_pos)
    }
pub fn world_to_tile ( & self , transform : & GlobalTransform , world_pos : Vec3 ) -> Option < IVec2 > { let tile_pos = self . world_to_tile_unchecked ( transform , world_pos ) ; if ! self . tile_in_bounds ( tile_pos ) { return None ; } Some ( tile_pos ) }
Converts a world position to a tile index.
Converts a world position to a tile index .
&self
transform
&GlobalTransform
world_pos
Vec3