Struct BiomeSearch
#[non_exhaustive]pub struct BiomeSearch {
pub origin: [i32; 3],
pub radius: i32,
pub horizontal_step: i32,
pub vertical_step: i32,
}Expand description
Sampling parameters for LevelRef::find_closest_biome, in blocks.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.origin: [i32; 3]Centre of the sampled spiral, in block coordinates.
radius: i32Maximum horizontal search radius in blocks.
horizontal_step: i32Distance between sampled columns in blocks.
vertical_step: i32Distance between sampled heights in blocks.
Implementations§
§impl BiomeSearch
impl BiomeSearch
pub const MAX_SAMPLES: u64 = 65_536
pub const MAX_SAMPLES: u64 = 65_536
Maximum potential biome samples in one synchronous search (65,536). Work is bounded before searching, even when the origin would match immediately.
pub fn new(
origin: [i32; 3],
radius: i32,
horizontal_step: i32,
vertical_step: i32,
) -> BiomeSearch
pub fn new( origin: [i32; 3], radius: i32, horizontal_step: i32, vertical_step: i32, ) -> BiomeSearch
The radius must be nonnegative and both sampling steps positive.
A search returns None if (2 * (radius / horizontal_step) + 1)^2
times ((dimension_height - 1) / vertical_step + 1) exceeds Self::MAX_SAMPLES.
Trait Implementations§
§impl Clone for BiomeSearch
impl Clone for BiomeSearch
§fn clone(&self) -> BiomeSearch
fn clone(&self) -> BiomeSearch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BiomeSearch
§impl Debug for BiomeSearch
impl Debug for BiomeSearch
impl Eq for BiomeSearch
§impl PartialEq for BiomeSearch
impl PartialEq for BiomeSearch
impl StructuralPartialEq for BiomeSearch
Auto Trait Implementations§
impl Freeze for BiomeSearch
impl RefUnwindSafe for BiomeSearch
impl Send for BiomeSearch
impl Sync for BiomeSearch
impl Unpin for BiomeSearch
impl UnsafeUnpin for BiomeSearch
impl UnwindSafe for BiomeSearch
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