Struct worley_noise::WorleyNoise[][src]

pub struct WorleyNoise { /* fields omitted */ }

The base noise struct.

Uses permutation arrays for efficiency. Use the WorleyNoise::permutate function to randomize it / adjust the size.

Caches already sampled values.

Sampling individual points is relatively slow due to the internal locks. Use the WorleyNoise::values function if sampling multiple points instead as it's concurrent.

Methods

impl WorleyNoise
[src]

DEFAULT_RADIUS: u16 = 1

DEFAULT_PERMUTATION_BITS: usize = 10

DEFAULT_DENSITY: f64 = 3.0

DEFAULT_CACHE_CAPACITY: usize = 2500

Creates a new noise struct with random permutation arrays.

Uses the default cache capacity of 2500.

Initializes the struct with the specified cache capacity.

Calls WorleyNoise::permutate_seeded with a random seed.

Randomizes the internal permutation arrays.

Generates permutation arrays with two to the power of permutation_table_bit_length entries.

This operation is fairly slow.

Sets the feature point density.

Might be slow since it precomputes a lot of stuff.

Default is 3.0.

Sets the function to calculate the distance between feature points.

Default is the squared Euclidean distance.

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.

Specifies how many adjacent cells should be included in the value calculation.

A higher radius reduces the amount of possible errors but slows down sampling of individual points.

Default is 1. That means it includes the feature points of the surrounding cells.

Calculates the noise value for the given point.

Calculates the noise values for the given points in parallel.

Auto Trait Implementations

impl !Send for WorleyNoise

impl Sync for WorleyNoise