pub struct TemperatureXzCache {
block_x: i32,
block_z: i32,
frozen_large_x7: f64,
frozen_edge: f64,
frozen_small: f64,
height_temp_noise_x8: f64,
}Expand description
Lazy XZ-only noise cache for SurfaceSystem::get_temperature.
All three noise samples used by get_temperature (frozen large/edge/small,
height-based temperature) are 2D — they only depend on (block_x, block_z).
The build_surface column scan calls cold_enough_to_snow once per Y, so
reusing these noise values across the whole column saves one sample per
rare-modifier hit and one per height-adjusted block.
NAN is the “not yet computed” sentinel: the noise functions only ever
return finite values, so any non-NaN read is a valid cached value. This
keeps the struct 16 bytes smaller than the equivalent Option<f64> layout
(no niche for f64).
Fields§
§block_x: i32§block_z: i32§frozen_large_x7: f64§frozen_edge: f64§frozen_small: f64§height_temp_noise_x8: f64Implementations§
Auto Trait Implementations§
impl Freeze for TemperatureXzCache
impl RefUnwindSafe for TemperatureXzCache
impl Send for TemperatureXzCache
impl Sync for TemperatureXzCache
impl Unpin for TemperatureXzCache
impl UnsafeUnpin for TemperatureXzCache
impl UnwindSafe for TemperatureXzCache
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
§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> ⓘ
Converts
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> ⓘ
Converts
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 moreWraps this value in an
Arc<SyncMutex<>>