Function planetkit::globe::origin_of_chunk_in_same_root_containing [] [src]

pub fn origin_of_chunk_in_same_root_containing(
    pos: GridPoint3,
    root_resolution: [GridCoord; 2],
    chunk_resolution: [GridCoord; 3]
) -> ChunkOrigin

Calculate the origin of a chunk that contains the given pos, with the guarantee that the chunk will be in the same root even if pos is on the edge of that root.

Note that this pays no attention to what chunk owns the cell, so you should assume that any chunk in this root that contains the position at all may be returned.