[][src]Struct procedural_generation::NoiseOptions

pub struct NoiseOptions {
    pub frequency: f64,
    pub redistribution: f64,
    pub octaves: usize,
}

Different options for defining how noise should behave.

Fields

frequency: f64

Higher frequency adds a zooming effect to the noise. Default is 1.0.

redistribution: f64

Higher redistribution exaggerates higher peaks and lower lows. Default is 1.0.

octaves: usize

More octaves increases variety. Default is 1.

Implementations

impl NoiseOptions[src]

pub fn new() -> Self[src]

Creates NoiseOptions. See Making maps with noise functions for more detail on each option. Usage of NoiseOptions looks like this:

fn main() {
    let noise_options = NoiseOptions { frequency: 4., ..NoiseOptions::default() };
    Generator::new()
        .with_size(40, 10)
        .with_options(noise_options)
        .spawn_perlin(|value| {
            if value > 0.5 {
                1
            } else {
                0
            }
        })
        .show();
}

Trait Implementations

impl Debug for NoiseOptions[src]

impl Default for NoiseOptions[src]

fn default() -> Self[src]

Return NoiseOptions { frequency: 1.0, redistribution: 1.0, octaves: 1 }

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<D> OwoColorize for D[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,