Struct noise::Turbulence
[−]
[src]
pub struct Turbulence<Source> { pub source: Source, pub frequency: f64, pub power: f64, pub roughness: usize, // some fields omitted }
Noise function that randomly displaces the input value before returning the output value from the source function.
_ is the pseudo-random displacement of the input value. The get() method randomly displaces the coordinates of the input value before retrieving the output value from the source function. To control the turbulence, an application can modify its frequency, its power, and its roughness.
Fields
source: Source
Source function that outputs a value.
frequency: f64
Frequency value for the Turbulence function.
power: f64
Controls the strength of the turbulence by affecting how much each point is moved.
roughness: usize
Affects the roughness of the turbulence. Higher values are rougher.
Methods
impl<Source> Turbulence<Source>
[src]
const DEFAULT_SEED: u32
DEFAULT_SEED: u32 = 0
const DEFAULT_FREQUENCY: f64
DEFAULT_FREQUENCY: f64 = 1.0
const DEFAULT_POWER: f64
DEFAULT_POWER: f64 = 1.0
const DEFAULT_ROUGHNESS: usize
DEFAULT_ROUGHNESS: usize = 3
fn new(source: Source) -> Self
[src]
fn set_frequency(self, frequency: f64) -> Self
[src]
fn set_power(self, power: f64) -> Self
[src]
fn set_roughness(self, roughness: usize) -> Self
[src]
Trait Implementations
impl<Source: Clone> Clone for Turbulence<Source>
[src]
fn clone(&self) -> Turbulence<Source>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Source: Debug> Debug for Turbulence<Source>
[src]
impl<Source> Seedable for Turbulence<Source>
[src]
fn set_seed(self, seed: u32) -> Self
[src]
Set the seed for the function implementing the Seedable
trait
fn seed(&self) -> u32
[src]
Getter to retrieve the seed from the function
impl<Source> NoiseFn<Point2<f64>> for Turbulence<Source> where
Source: NoiseFn<Point2<f64>>,
[src]
Source: NoiseFn<Point2<f64>>,
impl<Source> NoiseFn<Point3<f64>> for Turbulence<Source> where
Source: NoiseFn<Point3<f64>>,
[src]
Source: NoiseFn<Point3<f64>>,
impl<Source> NoiseFn<Point4<f64>> for Turbulence<Source> where
Source: NoiseFn<Point4<f64>>,
[src]
Source: NoiseFn<Point4<f64>>,