pub struct WorleyNoise { /* private fields */ }
Expand description

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.

Implementations§

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§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.