Struct libnoise::Simplex

source ·
pub struct Simplex<const D: usize> { /* private fields */ }
Expand description

A generator which produces n-dimensional simplex noise.

For details, see the documentation of simplex(). Typically, this struct is not meant to be used directly. Instead, simplex() implemented by Source, should be used to create a simplex noise generator.

§Direct usage of this struct

Direct instantiation of this struct:

let generator = Simplex::new(42);
let value = generator.sample([0.2, 0.5]);

Implementations§

source§

impl<const D: usize> Simplex<D>

source

pub fn new(seed: impl Seed) -> Self

Create a new simplex noise generator.

Trait Implementations§

source§

impl<const D: usize> Clone for Simplex<D>

source§

fn clone(&self) -> Simplex<D>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const D: usize> Debug for Simplex<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Generator<1> for Simplex<1>

source§

fn sample(&self, point: [f64; 1]) -> f64

Samples the generator at a given point and returns the resulting value. Read more
source§

fn scale(self, scale: [f64; D]) -> Scale<D, Self>

Create a generator which scales input points before passing them to the underlying generator. Read more
source§

fn translate(self, translation: [f64; D]) -> Translate<D, Self>

Create a generator which translates input points before passing them to the underlying generator. Read more
source§

fn neg(self) -> Neg<D, Self>

Create a generator which negates the results of the underlying generator. Read more
source§

fn abs(self) -> Abs<D, Self>

Create a generator returning the absolute value of the results of the underlying generator. Read more
source§

fn exp(self) -> Exp<D, Self>

Create a generator applying the exponential function on results of the underlying generator. Read more
source§

fn add(self, offset: f64) -> Add<D, Self>

Create a generator adding offset to results of the underlying generator. Read more
source§

fn mul(self, scale: f64) -> Mul<D, Self>

Create a generator multiplying scale to results of the underlying generator. Read more
source§

fn powi(self, exponent: i32) -> Pow<D, Self, i32>

Create a generator raising results of the underlying generator to the power of exponent. Read more
source§

fn powf(self, exponent: f64) -> Pow<D, Self, f64>

Create a generator raising results of the underlying generator to the power of exponent. Read more
source§

fn clamp(self, min: f64, max: f64) -> Clamp<D, Self>

Create a generator clamping results of the underlying generator to a given interval. Read more
source§

fn lambda<L>(self, lambda: L) -> Lambda<D, Self, L>
where L: Fn(f64) -> f64,

Create a generator applying the supplied closure to results of the underlying generator. Read more
source§

fn sum<G>(self, other: G) -> Sum<D, Self, G>
where G: Generator<D>,

Create a generator adding results of the underlying generator to results of a given other generator. Read more
source§

fn product<G>(self, other: G) -> Product<D, Self, G>
where G: Generator<D>,

Create a generator multiplying results of the underlying generator to results of a given other generator. Read more
source§

fn min<G>(self, other: G) -> Min<D, Self, G>
where G: Generator<D>,

Create a generator producing the minimum of results of the underlying generator and results of a given other generator. Read more
source§

fn max<G>(self, other: G) -> Max<D, Self, G>
where G: Generator<D>,

Create a generator producing the maximum of results of the underlying generator and results of a given other generator. Read more
source§

fn power<G>(self, other: G) -> Power<D, Self, G>
where G: Generator<D>,

Create a generator raising results of the underlying generator to the power of results of a given other generator. Read more
source§

fn fbm( self, octaves: u32, frequency: f64, lacunarity: f64, persistence: f64 ) -> Fbm<D, Self>

Create a generator applying fractal brownian motion on the underlying generator. Read more
source§

fn billow( self, octaves: u32, frequency: f64, lacunarity: f64, persistence: f64 ) -> Billow<D, Self>

Create a generator applying an fbm()-like effect on the underlying generator. Read more
source§

fn ridgedmulti( self, octaves: u32, frequency: f64, lacunarity: f64, attenuation: f64 ) -> RidgedMulti<D, Self>

Create a generator applying an fbm()-like effect on the underlying generator. Read more
source§

fn blend<G, GC>(self, other: G, control: GC) -> Blend<D, Self, G, GC>
where G: Generator<D>, GC: Generator<D>,

Create a generator blending the underlying generator with a given other generator based on the value supplied by a control-generator. Read more
source§

fn select<G, GC>( self, other: G, control: GC, selection_min: f64, selection_max: f64 ) -> Select<D, Self, G, GC>
where G: Generator<D>, GC: Generator<D>,

Create a generator selecting the result of either the underlying generator or that of a given other generator based on whether the value supplied by a control-generator lies within the provided interval. Read more
source§

impl Generator<2> for Simplex<2>

source§

fn sample(&self, point: [f64; 2]) -> f64

Samples the generator at a given point and returns the resulting value. Read more
source§

fn scale(self, scale: [f64; D]) -> Scale<D, Self>

Create a generator which scales input points before passing them to the underlying generator. Read more
source§

fn translate(self, translation: [f64; D]) -> Translate<D, Self>

Create a generator which translates input points before passing them to the underlying generator. Read more
source§

fn neg(self) -> Neg<D, Self>

Create a generator which negates the results of the underlying generator. Read more
source§

fn abs(self) -> Abs<D, Self>

Create a generator returning the absolute value of the results of the underlying generator. Read more
source§

fn exp(self) -> Exp<D, Self>

Create a generator applying the exponential function on results of the underlying generator. Read more
source§

fn add(self, offset: f64) -> Add<D, Self>

Create a generator adding offset to results of the underlying generator. Read more
source§

fn mul(self, scale: f64) -> Mul<D, Self>

Create a generator multiplying scale to results of the underlying generator. Read more
source§

fn powi(self, exponent: i32) -> Pow<D, Self, i32>

Create a generator raising results of the underlying generator to the power of exponent. Read more
source§

fn powf(self, exponent: f64) -> Pow<D, Self, f64>

Create a generator raising results of the underlying generator to the power of exponent. Read more
source§

fn clamp(self, min: f64, max: f64) -> Clamp<D, Self>

Create a generator clamping results of the underlying generator to a given interval. Read more
source§

fn lambda<L>(self, lambda: L) -> Lambda<D, Self, L>
where L: Fn(f64) -> f64,

Create a generator applying the supplied closure to results of the underlying generator. Read more
source§

fn sum<G>(self, other: G) -> Sum<D, Self, G>
where G: Generator<D>,

Create a generator adding results of the underlying generator to results of a given other generator. Read more
source§

fn product<G>(self, other: G) -> Product<D, Self, G>
where G: Generator<D>,

Create a generator multiplying results of the underlying generator to results of a given other generator. Read more
source§

fn min<G>(self, other: G) -> Min<D, Self, G>
where G: Generator<D>,

Create a generator producing the minimum of results of the underlying generator and results of a given other generator. Read more
source§

fn max<G>(self, other: G) -> Max<D, Self, G>
where G: Generator<D>,

Create a generator producing the maximum of results of the underlying generator and results of a given other generator. Read more
source§

fn power<G>(self, other: G) -> Power<D, Self, G>
where G: Generator<D>,

Create a generator raising results of the underlying generator to the power of results of a given other generator. Read more
source§

fn fbm( self, octaves: u32, frequency: f64, lacunarity: f64, persistence: f64 ) -> Fbm<D, Self>

Create a generator applying fractal brownian motion on the underlying generator. Read more
source§

fn billow( self, octaves: u32, frequency: f64, lacunarity: f64, persistence: f64 ) -> Billow<D, Self>

Create a generator applying an fbm()-like effect on the underlying generator. Read more
source§

fn ridgedmulti( self, octaves: u32, frequency: f64, lacunarity: f64, attenuation: f64 ) -> RidgedMulti<D, Self>

Create a generator applying an fbm()-like effect on the underlying generator. Read more
source§

fn blend<G, GC>(self, other: G, control: GC) -> Blend<D, Self, G, GC>
where G: Generator<D>, GC: Generator<D>,

Create a generator blending the underlying generator with a given other generator based on the value supplied by a control-generator. Read more
source§

fn select<G, GC>( self, other: G, control: GC, selection_min: f64, selection_max: f64 ) -> Select<D, Self, G, GC>
where G: Generator<D>, GC: Generator<D>,

Create a generator selecting the result of either the underlying generator or that of a given other generator based on whether the value supplied by a control-generator lies within the provided interval. Read more
source§

impl Generator<3> for Simplex<3>

source§

fn sample(&self, point: [f64; 3]) -> f64

Samples the generator at a given point and returns the resulting value. Read more
source§

fn scale(self, scale: [f64; D]) -> Scale<D, Self>

Create a generator which scales input points before passing them to the underlying generator. Read more
source§

fn translate(self, translation: [f64; D]) -> Translate<D, Self>

Create a generator which translates input points before passing them to the underlying generator. Read more
source§

fn neg(self) -> Neg<D, Self>

Create a generator which negates the results of the underlying generator. Read more
source§

fn abs(self) -> Abs<D, Self>

Create a generator returning the absolute value of the results of the underlying generator. Read more
source§

fn exp(self) -> Exp<D, Self>

Create a generator applying the exponential function on results of the underlying generator. Read more
source§

fn add(self, offset: f64) -> Add<D, Self>

Create a generator adding offset to results of the underlying generator. Read more
source§

fn mul(self, scale: f64) -> Mul<D, Self>

Create a generator multiplying scale to results of the underlying generator. Read more
source§

fn powi(self, exponent: i32) -> Pow<D, Self, i32>

Create a generator raising results of the underlying generator to the power of exponent. Read more
source§

fn powf(self, exponent: f64) -> Pow<D, Self, f64>

Create a generator raising results of the underlying generator to the power of exponent. Read more
source§

fn clamp(self, min: f64, max: f64) -> Clamp<D, Self>

Create a generator clamping results of the underlying generator to a given interval. Read more
source§

fn lambda<L>(self, lambda: L) -> Lambda<D, Self, L>
where L: Fn(f64) -> f64,

Create a generator applying the supplied closure to results of the underlying generator. Read more
source§

fn sum<G>(self, other: G) -> Sum<D, Self, G>
where G: Generator<D>,

Create a generator adding results of the underlying generator to results of a given other generator. Read more
source§

fn product<G>(self, other: G) -> Product<D, Self, G>
where G: Generator<D>,

Create a generator multiplying results of the underlying generator to results of a given other generator. Read more
source§

fn min<G>(self, other: G) -> Min<D, Self, G>
where G: Generator<D>,

Create a generator producing the minimum of results of the underlying generator and results of a given other generator. Read more
source§

fn max<G>(self, other: G) -> Max<D, Self, G>
where G: Generator<D>,

Create a generator producing the maximum of results of the underlying generator and results of a given other generator. Read more
source§

fn power<G>(self, other: G) -> Power<D, Self, G>
where G: Generator<D>,

Create a generator raising results of the underlying generator to the power of results of a given other generator. Read more
source§

fn fbm( self, octaves: u32, frequency: f64, lacunarity: f64, persistence: f64 ) -> Fbm<D, Self>

Create a generator applying fractal brownian motion on the underlying generator. Read more
source§

fn billow( self, octaves: u32, frequency: f64, lacunarity: f64, persistence: f64 ) -> Billow<D, Self>

Create a generator applying an fbm()-like effect on the underlying generator. Read more
source§

fn ridgedmulti( self, octaves: u32, frequency: f64, lacunarity: f64, attenuation: f64 ) -> RidgedMulti<D, Self>

Create a generator applying an fbm()-like effect on the underlying generator. Read more
source§

fn blend<G, GC>(self, other: G, control: GC) -> Blend<D, Self, G, GC>
where G: Generator<D>, GC: Generator<D>,

Create a generator blending the underlying generator with a given other generator based on the value supplied by a control-generator. Read more
source§

fn select<G, GC>( self, other: G, control: GC, selection_min: f64, selection_max: f64 ) -> Select<D, Self, G, GC>
where G: Generator<D>, GC: Generator<D>,

Create a generator selecting the result of either the underlying generator or that of a given other generator based on whether the value supplied by a control-generator lies within the provided interval. Read more
source§

impl Generator<4> for Simplex<4>

source§

fn sample(&self, point: [f64; 4]) -> f64

Samples the generator at a given point and returns the resulting value. Read more
source§

fn scale(self, scale: [f64; D]) -> Scale<D, Self>

Create a generator which scales input points before passing them to the underlying generator. Read more
source§

fn translate(self, translation: [f64; D]) -> Translate<D, Self>

Create a generator which translates input points before passing them to the underlying generator. Read more
source§

fn neg(self) -> Neg<D, Self>

Create a generator which negates the results of the underlying generator. Read more
source§

fn abs(self) -> Abs<D, Self>

Create a generator returning the absolute value of the results of the underlying generator. Read more
source§

fn exp(self) -> Exp<D, Self>

Create a generator applying the exponential function on results of the underlying generator. Read more
source§

fn add(self, offset: f64) -> Add<D, Self>

Create a generator adding offset to results of the underlying generator. Read more
source§

fn mul(self, scale: f64) -> Mul<D, Self>

Create a generator multiplying scale to results of the underlying generator. Read more
source§

fn powi(self, exponent: i32) -> Pow<D, Self, i32>

Create a generator raising results of the underlying generator to the power of exponent. Read more
source§

fn powf(self, exponent: f64) -> Pow<D, Self, f64>

Create a generator raising results of the underlying generator to the power of exponent. Read more
source§

fn clamp(self, min: f64, max: f64) -> Clamp<D, Self>

Create a generator clamping results of the underlying generator to a given interval. Read more
source§

fn lambda<L>(self, lambda: L) -> Lambda<D, Self, L>
where L: Fn(f64) -> f64,

Create a generator applying the supplied closure to results of the underlying generator. Read more
source§

fn sum<G>(self, other: G) -> Sum<D, Self, G>
where G: Generator<D>,

Create a generator adding results of the underlying generator to results of a given other generator. Read more
source§

fn product<G>(self, other: G) -> Product<D, Self, G>
where G: Generator<D>,

Create a generator multiplying results of the underlying generator to results of a given other generator. Read more
source§

fn min<G>(self, other: G) -> Min<D, Self, G>
where G: Generator<D>,

Create a generator producing the minimum of results of the underlying generator and results of a given other generator. Read more
source§

fn max<G>(self, other: G) -> Max<D, Self, G>
where G: Generator<D>,

Create a generator producing the maximum of results of the underlying generator and results of a given other generator. Read more
source§

fn power<G>(self, other: G) -> Power<D, Self, G>
where G: Generator<D>,

Create a generator raising results of the underlying generator to the power of results of a given other generator. Read more
source§

fn fbm( self, octaves: u32, frequency: f64, lacunarity: f64, persistence: f64 ) -> Fbm<D, Self>

Create a generator applying fractal brownian motion on the underlying generator. Read more
source§

fn billow( self, octaves: u32, frequency: f64, lacunarity: f64, persistence: f64 ) -> Billow<D, Self>

Create a generator applying an fbm()-like effect on the underlying generator. Read more
source§

fn ridgedmulti( self, octaves: u32, frequency: f64, lacunarity: f64, attenuation: f64 ) -> RidgedMulti<D, Self>

Create a generator applying an fbm()-like effect on the underlying generator. Read more
source§

fn blend<G, GC>(self, other: G, control: GC) -> Blend<D, Self, G, GC>
where G: Generator<D>, GC: Generator<D>,

Create a generator blending the underlying generator with a given other generator based on the value supplied by a control-generator. Read more
source§

fn select<G, GC>( self, other: G, control: GC, selection_min: f64, selection_max: f64 ) -> Select<D, Self, G, GC>
where G: Generator<D>, GC: Generator<D>,

Create a generator selecting the result of either the underlying generator or that of a given other generator based on whether the value supplied by a control-generator lies within the provided interval. Read more
source§

impl Generator1D for Simplex<1>

source§

fn displace_x<GA>(self, displacement_generator: GA) -> Displace<1, 0, Self, GA>
where GA: Generator<1>,

Create a generator providing the results of the underlying generator after displacing the x-coordinate by the result of the provided generator. Read more
source§

impl Generator2D for Simplex<2>

source§

fn rotate(self, rotation: [f64; 1]) -> Rotate<2, 1, Self>

Create a generator which rotates input points before passing them to the underlying generator. Read more
source§

fn displace_x<GA>(self, displacement_generator: GA) -> Displace<2, 0, Self, GA>
where GA: Generator<2>,

Create a generator providing the results of the underlying generator after displacing the x-coordinate by the result of the provided generator. Read more
source§

fn displace_y<GA>(self, displacement_generator: GA) -> Displace<2, 1, Self, GA>
where GA: Generator<2>,

Create a generator providing the results of the underlying generator after displacing the y-coordinate by the result of the provided generator. Read more
source§

impl Generator3D for Simplex<3>

source§

fn rotate(self, rotation: [f64; 3]) -> Rotate<3, 3, Self>

Create a generator which rotates input points before passing them to the underlying generator. Read more
source§

fn displace_x<GA>(self, displacement_generator: GA) -> Displace<3, 0, Self, GA>
where GA: Generator<3>,

Create a generator providing the results of the underlying generator after displacing the x-coordinate by the result of the provided generator. Read more
source§

fn displace_y<GA>(self, displacement_generator: GA) -> Displace<3, 1, Self, GA>
where GA: Generator<3>,

Create a generator providing the results of the underlying generator after displacing the y-coordinate by the result of the provided generator. Read more
source§

fn displace_z<GA>(self, displacement_generator: GA) -> Displace<3, 2, Self, GA>
where GA: Generator<3>,

Create a generator providing the results of the underlying generator after displacing the z-coordinate by the result of the provided generator. Read more
source§

impl Generator4D for Simplex<4>

source§

fn rotate(self, rotation: [f64; 6]) -> Rotate<4, 6, Self>

Create a generator which rotates input points before passing them to the underlying generator.
source§

fn displace_x<GA>(self, displacement_generator: GA) -> Displace<4, 0, Self, GA>
where GA: Generator<4>,

Create a generator providing the results of the underlying generator after displacing the x-coordinate by the result of the provided generator. Read more
source§

fn displace_y<GA>(self, displacement_generator: GA) -> Displace<4, 1, Self, GA>
where GA: Generator<4>,

Create a generator providing the results of the underlying generator after displacing the y-coordinate by the result of the provided generator. Read more
source§

fn displace_z<GA>(self, displacement_generator: GA) -> Displace<4, 2, Self, GA>
where GA: Generator<4>,

Create a generator providing the results of the underlying generator after displacing the z-coordinate by the result of the provided generator. Read more
source§

fn displace_w<GA>(self, displacement_generator: GA) -> Displace<4, 3, Self, GA>
where GA: Generator<4>,

Create a generator providing the results of the underlying generator after displacing the w-coordinate by the result of the provided generator. Read more

Auto Trait Implementations§

§

impl<const D: usize> RefUnwindSafe for Simplex<D>

§

impl<const D: usize> Send for Simplex<D>

§

impl<const D: usize> Sync for Simplex<D>

§

impl<const D: usize> Unpin for Simplex<D>

§

impl<const D: usize> UnwindSafe for Simplex<D>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V