Struct worley_noise::WorleyNoise
[−]
[src]
pub struct WorleyNoise { /* fields omitted */ }
The base noise struct
Caches already sampled values
Methods
impl WorleyNoise
[src]
fn new() -> Self
[src]
Creates a new noise struct with random permutation arrays
Uses a default density of 3.0 and a cache capacity of 1000
fn with_density(density: f64) -> Self
[src]
Initializes the struct with the specified density
fn with_cache_capacity(capacity: usize) -> Self
[src]
Initializes the struct with the specified cache capacity
fn with_density_and_cache_capacity(density: f64, capacity: usize) -> Self
[src]
Initializes the struct with the specified density and cache capacity
fn permutate(&mut self, permutation_table_bit_length: usize)
[src]
Calls permutate_seeded with a random seed
fn permutate_seeded(&mut self, permutation_table_bit_length: usize, seed: usize)
[src]
Randomizes the internal permutation arrays
Might be slow
fn set_density(&mut self, density: f64)
[src]
Sets the density
Might be slow since it precomputes a lot of stuff
fn set_distance_function<F>(&mut self, function: F) where
F: FnMut(f64, f64) -> f64 + 'static,
[src]
F: FnMut(f64, f64) -> f64 + 'static,
Sets the function to calculate the distance between feature points
Default is the squared Euclidean distance
fn set_value_function<F>(&mut self, function: F) where
F: FnMut(Vec<f64>) -> f64 + 'static,
[src]
F: FnMut(Vec<f64>) -> f64 + 'static,
Sets the function to pick the final value from the nearby feature points
The values are in no particular order
Default is the minimum value
fn value(&mut self, x: f64, y: f64) -> f64
[src]
Calculates the noise value for the given point