pub struct Worley {
pub distance_function: Rc<dyn Fn(&[f64], &[f64]) -> f64>,
pub return_type: ReturnType,
pub frequency: f64,
/* private fields */
}
Expand description
Noise function that outputs Worley noise.
Fields§
§distance_function: Rc<dyn Fn(&[f64], &[f64]) -> f64>
Specifies the distance function to use when calculating the boundaries of the cell.
return_type: ReturnType
Signifies whether the distance from the borders of the cell should be returned, or the value for the cell.
frequency: f64
Frequency of the seed points.
Implementations§
source§impl Worley
impl Worley
pub const DEFAULT_SEED: u32 = 0u32
pub const DEFAULT_FREQUENCY: f64 = 1f64
pub fn new(seed: u32) -> Self
sourcepub fn set_distance_function<F>(self, function: F) -> Self
pub fn set_distance_function<F>(self, function: F) -> Self
Sets the distance function used by the Worley cells.
sourcepub fn set_return_type(self, return_type: ReturnType) -> Self
pub fn set_return_type(self, return_type: ReturnType) -> Self
Enables or disables applying the distance from the nearest seed point to the output value.
sourcepub fn set_frequency(self, frequency: f64) -> Self
pub fn set_frequency(self, frequency: f64) -> Self
Sets the frequency of the seed points.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Worley
impl !RefUnwindSafe for Worley
impl !Send for Worley
impl !Sync for Worley
impl Unpin for Worley
impl !UnwindSafe for Worley
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