pub struct OverworldClimateSampler {
noises: Box<OverworldNoises>,
}Expand description
Climate sampler for the overworld using compiled density functions.
Evaluates the overworld noise router (temperature, vegetation, continentalness,
erosion, depth, ridges) to produce TargetPoint values for biome lookup.
Fields§
§noises: Box<OverworldNoises>All noise generators needed by the overworld density functions.
Boxed because OverworldNoises is ~5600 bytes (35 NormalNoise fields).
Implementations§
Source§impl OverworldClimateSampler
impl OverworldClimateSampler
Sourcepub fn sample(
&self,
quart_x: i32,
quart_y: i32,
quart_z: i32,
cache: &mut OverworldColumnCache,
) -> TargetPoint
pub fn sample( &self, quart_x: i32, quart_y: i32, quart_z: i32, cache: &mut OverworldColumnCache, ) -> TargetPoint
Sample climate at a quart position.
The cache holds column-level (xz-only) precomputed values.
It should persist across calls for the same chunk to avoid redundant
noise evaluations when only y changes.
Sourcepub fn init_column_grid(
&self,
cache: &mut OverworldColumnCache,
chunk_block_x: i32,
chunk_block_z: i32,
)
pub fn init_column_grid( &self, cache: &mut OverworldColumnCache, chunk_block_x: i32, chunk_block_z: i32, )
Pre-populate a column cache’s flat-noise grid for a chunk’s quart columns.
The biome stage samples every quart cell in a chunk (1536 for the
overworld) in section → x → y → z order. Without a grid, the cache is a
single-entry lazy cache that misses on every cell (the innermost z loop
changes column each step), so the expensive flat (xz-only) climate noise
is recomputed per cell. Pre-computing the grid once — exactly as the noise
stage’s fill_from_noise does — turns those into O(1) lookups. Bit-identical
because the grid evaluates the same functions at the same quart coordinates.
Sourcepub fn find_spawn_position(&self) -> BlockPos
pub fn find_spawn_position(&self) -> BlockPos
Finds the climate-biased overworld spawn origin.
This mirrors vanilla’s Climate.Sampler.findSpawnPosition() with
OverworldBiomeBuilder.spawnTarget().
fn radial_spawn_search( &self, spawn_targets: &[ParameterPoint; 2], result: SpawnSearchResult, max_radius: f32, radius_increment: f32, ) -> SpawnSearchResult
fn spawn_position_and_fitness( &self, spawn_targets: &[ParameterPoint; 2], block_x: i32, block_z: i32, ) -> SpawnSearchResult
Auto Trait Implementations§
impl Freeze for OverworldClimateSampler
impl RefUnwindSafe for OverworldClimateSampler
impl Send for OverworldClimateSampler
impl Sync for OverworldClimateSampler
impl Unpin for OverworldClimateSampler
impl UnsafeUnpin for OverworldClimateSampler
impl UnwindSafe for OverworldClimateSampler
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
§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<>>