pub struct PerlinNoise {
pub persistence: f32,
pub octaves: f32,
pub seed_x: i32,
pub seed_y: i32,
}Expand description
A noise field: its persistence, octaves and two seeds.
Fields§
§persistence: f32How much each octave adds: octave i is scaled by persistence to the power i.
octaves: f32The number of octaves. The loop runs while (float)i < octaves.
seed_x: i32The first seed of the hash.
seed_y: i32The second seed of the hash.
Implementations§
Source§impl PerlinNoise
impl PerlinNoise
Sourcepub fn new(persistence: f32, octaves: f32, seed_x: i32, seed_y: i32) -> Self
pub fn new(persistence: f32, octaves: f32, seed_x: i32, seed_y: i32) -> Self
A noise field with these settings.
Original: PerlinNoise(float, float, int, int), Runtime 0x18010b500.
Sourcepub fn random(&self, x: i32, y: i32) -> f32
pub fn random(&self, x: i32, y: i32) -> f32
The hashed value at an integer point, from -1 to 1.
Original: Random(int, int), Runtime 0x18010ad80.
Sourcepub fn smooth_noise(&self, x: i32, y: i32) -> f32
pub fn smooth_noise(&self, x: i32, y: i32) -> f32
The value at an integer point, smoothed with its 8 neighbours: corners / 16 + edges / 8 + centre / 4, added in the original’s order.
Original: SmoothNoise(int, int), Runtime 0x18010ae50.
Trait Implementations§
Source§impl Clone for PerlinNoise
impl Clone for PerlinNoise
Source§fn clone(&self) -> PerlinNoise
fn clone(&self) -> PerlinNoise
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PerlinNoise
Source§impl Debug for PerlinNoise
impl Debug for PerlinNoise
Source§impl PartialEq for PerlinNoise
impl PartialEq for PerlinNoise
impl StructuralPartialEq for PerlinNoise
Auto Trait Implementations§
impl Freeze for PerlinNoise
impl RefUnwindSafe for PerlinNoise
impl Send for PerlinNoise
impl Sync for PerlinNoise
impl Unpin for PerlinNoise
impl UnsafeUnpin for PerlinNoise
impl UnwindSafe for PerlinNoise
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