pub struct OverworldColumnCache {Show 42 fields
pub x: i32,
pub z: i32,
qx: i32,
qz: i32,
valid: bool,
grid_first_quart_x: i32,
grid_first_quart_z: i32,
has_grid: bool,
pub df_shift_x: f64,
pub df_shift_z: f64,
pub df_overworld__continents: f64,
pub df_overworld__erosion: f64,
pub df_overworld__ridges: f64,
pub df_overworld__ridges_folded: f64,
pub df_overworld__offset: f64,
pub df_overworld__factor: f64,
pub df_overworld__jaggedness: f64,
pub router_continentalness: f64,
pub router_erosion: f64,
pub router_preliminary_surface_level: f64,
pub router_ridges: f64,
pub router_temperature: f64,
pub router_vegetation: f64,
pub inline_noise_0: f64,
pub inline_noise_1: f64,
grid_df_shift_x: [f64; 25],
grid_df_shift_z: [f64; 25],
grid_df_overworld__continents: [f64; 25],
grid_df_overworld__erosion: [f64; 25],
grid_df_overworld__ridges: [f64; 25],
grid_df_overworld__ridges_folded: [f64; 25],
grid_df_overworld__offset: [f64; 25],
grid_df_overworld__factor: [f64; 25],
grid_df_overworld__jaggedness: [f64; 25],
grid_router_continentalness: [f64; 25],
grid_router_erosion: [f64; 25],
grid_router_preliminary_surface_level: [f64; 25],
grid_router_ridges: [f64; 25],
grid_router_temperature: [f64; 25],
grid_router_vegetation: [f64; 25],
grid_inline_noise_0: [f64; 25],
grid_inline_noise_1: [f64; 25],
}Expand description
Column-level cache for flat-cached (xz-only) density function results.
Supports two modes matching vanilla’s NoiseChunk.FlatCache:
- Grid mode (
init_grid()called): Pre-computes a 2D grid of all in-chunk quart positions.ensure()does O(1) grid lookups for in-bounds positions, falls back to on-the-fly for out-of-bounds. - No-grid mode (default): Single-entry lazy cache that recomputes when quart-quantized coordinates change. Used by climate samplers.
Fields§
§x: i32Raw x block coordinate (for non-flat router functions).
z: i32Raw z block coordinate (for non-flat router functions).
qx: i32Effective x used to evaluate flat-cached values.
qz: i32Effective z used to evaluate flat-cached values.
valid: bool§grid_first_quart_x: i32§grid_first_quart_z: i32§has_grid: bool§df_shift_x: f64§df_shift_z: f64§df_overworld__continents: f64§df_overworld__erosion: f64§df_overworld__ridges: f64§df_overworld__ridges_folded: f64§df_overworld__offset: f64§df_overworld__factor: f64§df_overworld__jaggedness: f64§router_continentalness: f64§router_erosion: f64§router_preliminary_surface_level: f64§router_ridges: f64§router_temperature: f64§router_vegetation: f64§inline_noise_0: f64§inline_noise_1: f64§grid_df_shift_x: [f64; 25]§grid_df_shift_z: [f64; 25]§grid_df_overworld__continents: [f64; 25]§grid_df_overworld__erosion: [f64; 25]§grid_df_overworld__ridges: [f64; 25]§grid_df_overworld__ridges_folded: [f64; 25]§grid_df_overworld__offset: [f64; 25]§grid_df_overworld__factor: [f64; 25]§grid_df_overworld__jaggedness: [f64; 25]§grid_router_continentalness: [f64; 25]§grid_router_erosion: [f64; 25]§grid_router_preliminary_surface_level: [f64; 25]§grid_router_ridges: [f64; 25]§grid_router_temperature: [f64; 25]§grid_router_vegetation: [f64; 25]§grid_inline_noise_0: [f64; 25]§grid_inline_noise_1: [f64; 25]Implementations§
Source§impl OverworldColumnCache
impl OverworldColumnCache
Sourcepub fn init_grid(
&mut self,
chunk_block_x: i32,
chunk_block_z: i32,
noises: &OverworldNoises,
)
pub fn init_grid( &mut self, chunk_block_x: i32, chunk_block_z: i32, noises: &OverworldNoises, )
Pre-compute flat-cached values for all quart positions in a chunk.
After this call, ensure() for in-bounds positions copies from
the grid (O(1)). Out-of-bounds positions fall back to on-the-fly
evaluation at raw (non-quantized) coordinates.
Sourcepub fn ensure(&mut self, x: i32, z: i32, noises: &OverworldNoises)
pub fn ensure(&mut self, x: i32, z: i32, noises: &OverworldNoises)
Ensure the cache is populated for the given (x, z) block coordinates.
With a grid: in-bounds positions load from the pre-computed grid, out-of-bounds positions compute at raw (non-quantized) coordinates. Without a grid: always quantizes and lazy-computes (single-entry cache).
Trait Implementations§
Source§impl Clone for OverworldColumnCache
impl Clone for OverworldColumnCache
Source§fn clone(&self) -> OverworldColumnCache
fn clone(&self) -> OverworldColumnCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ColumnCache for OverworldColumnCache
impl ColumnCache for OverworldColumnCache
Auto Trait Implementations§
impl Freeze for OverworldColumnCache
impl RefUnwindSafe for OverworldColumnCache
impl Send for OverworldColumnCache
impl Sync for OverworldColumnCache
impl Unpin for OverworldColumnCache
impl UnsafeUnpin for OverworldColumnCache
impl UnwindSafe for OverworldColumnCache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>