pub struct Simplex { /* private fields */ }Expand description
Simplex noise generator instance that keeps a permutation table internally.
Implementations§
Source§impl Simplex
impl Simplex
Sourcepub fn new(seed: u64) -> Self
pub fn new(seed: u64) -> Self
Create a new simplex noise generator for the given seed value.
Creates a pre-computed permutation table using the seed value.
Sourcepub fn sample2d(&self, x: f32, y: f32) -> f32
pub fn sample2d(&self, x: f32, y: f32) -> f32
Sample the noise function in 2D at the given coordinates.
For frequency, multiply the coordinates by the desired frequency.
Auto Trait Implementations§
impl Freeze for Simplex
impl RefUnwindSafe for Simplex
impl Send for Simplex
impl Sync for Simplex
impl Unpin for Simplex
impl UnwindSafe for Simplex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more