pub struct ChunkGrid {
pub origin_domain: Vec2,
pub cell_size: f32,
pub width: usize,
pub height: usize,
pub halo: usize,
}Expand description
Defines a 2D grid of cells with halo regions for chunked processing.
Fields§
§origin_domain: Vec2World-space origin of the chunk grid (lower-left corner).
cell_size: f32Cell size in world units.
width: usizeNumber of cells in X, excluding halo.
height: usizeNumber of cells in Y, excluding halo.
halo: usizeHalo cell count on each side.
Implementations§
Source§impl ChunkGrid
impl ChunkGrid
Sourcepub fn total_width(&self) -> usize
pub fn total_width(&self) -> usize
Total width including halo regions.
Sourcepub fn total_height(&self) -> usize
pub fn total_height(&self) -> usize
Total height including halo regions.
Sourcepub fn world_to_index(&self, p: Vec2) -> (isize, isize)
pub fn world_to_index(&self, p: Vec2) -> (isize, isize)
Converts a world position to grid cell indices, accounting for halo.
Sourcepub fn index_to_world(&self, ix: isize, iy: isize) -> Vec2
pub fn index_to_world(&self, ix: isize, iy: isize) -> Vec2
Converts grid cell indices back to world position at the cell center, accounting for halo.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ChunkGrid
impl Freeze for ChunkGrid
impl RefUnwindSafe for ChunkGrid
impl Send for ChunkGrid
impl Sync for ChunkGrid
impl Unpin for ChunkGrid
impl UnsafeUnpin for ChunkGrid
impl UnwindSafe for ChunkGrid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more