Struct ImplicitFractal

Source
pub struct ImplicitFractal { /* private fields */ }
Expand description

Fractals are a special type of combiner that combine up to 20 noise sources using fractal methods pioneered by Perlin, Musgrave, and friends. They come in various types (specifiable through set_type() or in the constructor). Each fractal has up to 20 built-in BasisFunctions whose basistype and interptype can be set via the provided methods. Additionally, you can obtain a pointer to any source of the fractal via get_basis(). Any source module in the fractal may also be overridden by an external noise function via overrideSource(). The complexity of this system serves a purpose: “generic” fractals of a given type, with basis functions of all the same type, can easily be instance just by construction, yet more complex behavior can be produced by overriding layers with external sources, to build up very complex fractals, if so desired. Fractals are highly parameterized. The two most useful parameters are numoctaves which determines how many layers contribute to the fractal, and frequency which specifies the density of the function. Frequency mimics combining a ScaleDomain function to the source, multiplying the input coordinates by frequency before calculating the function. Other parameters that control the fractal are offset, lacunarity, gain and H. These parameters can have subtle, drastic, or no effect on the fractal, depending on the type, and they are typically best left alone.

Implementations§

Source§

impl ImplicitFractal

Source

pub fn set_num_octaves(&mut self, n: u32)

Source

pub fn set_frequency(&mut self, f: f64)

Source

pub fn set_lacunarity(&mut self, l: f64)

Source

pub fn set_gain(&mut self, g: f64)

Source

pub fn set_offset(&mut self, o: f64)

Source

pub fn set_h(&mut self, h: f64)

Source

pub fn new( ftype: FractalType, basistype: BasisType, interptype: InterpType, ) -> ImplicitFractal

Source

pub fn set_type(&mut self, t: FractalType)

Source

pub fn set_all_source_types( &mut self, basis_type: BasisType, interp: InterpType, )

Source

pub fn set_source_type( &mut self, which: usize, basis_type: BasisType, interp: InterpType, )

Source

pub fn override_source( &mut self, which: usize, b: Option<Rc<RefCell<dyn ImplicitModule>>>, )

Source

pub fn reset_source(&mut self, which: usize)

Source

pub fn reset_all_sources(&mut self)

Source

pub fn get_basis( &mut self, which: usize, ) -> Option<Rc<RefCell<ImplicitBasisFunction>>>

Source

pub fn decarpentier_swiss_calc_weights(&mut self)

Source

pub fn billow_calc_weights(&mut self)

Source

pub fn multi_calc_weights(&mut self)

Source

pub fn hybrid_multi_calc_weights(&mut self)

Source

pub fn fbm_get_2d(&mut self, x: f64, y: f64) -> f64

Source

pub fn fbm_get_3d(&mut self, x: f64, y: f64, z: f64) -> f64

Source

pub fn fbm_get_4d(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source

pub fn fbm_get_6d( &mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64, ) -> f64

Source

pub fn multi_get_2d(&mut self, x: f64, y: f64) -> f64

Source

pub fn multi_get_4d(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source

pub fn multi_get_3d(&mut self, x: f64, y: f64, z: f64) -> f64

Source

pub fn multi_get_6d( &mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64, ) -> f64

Source

pub fn billow_get_2d(&mut self, x: f64, y: f64) -> f64

Source

pub fn billow_get_4d(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source

pub fn billow_get_3d(&mut self, x: f64, y: f64, z: f64) -> f64

Source

pub fn billow_get_6d( &mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64, ) -> f64

Source

pub fn ridged_multi_get_2d(&mut self, x: f64, y: f64) -> f64

Source

pub fn ridged_multi_get_4d(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source

pub fn ridged_multi_get_3d(&mut self, x: f64, y: f64, z: f64) -> f64

Source

pub fn ridged_multi_get_6d( &mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64, ) -> f64

Source

pub fn hybrid_multi_get_2d(&mut self, x: f64, y: f64) -> f64

Source

pub fn hybrid_multi_get_3d(&mut self, x: f64, y: f64, z: f64) -> f64

Source

pub fn hybrid_multi_get_4d(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source

pub fn hybrid_multi_get_6d( &mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64, ) -> f64

Source

pub fn decarpentier_swiss_get_2d(&mut self, x: f64, y: f64) -> f64

Source

pub fn decarpentier_swiss_get_4d( &mut self, x: f64, y: f64, z: f64, w: f64, ) -> f64

Source

pub fn decarpentier_swiss_get_3d(&mut self, x: f64, y: f64, z: f64) -> f64

Source

pub fn decarpentier_swiss_get_6d( &mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64, ) -> f64

Trait Implementations§

Source§

impl Default for ImplicitFractal

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ImplicitModule for ImplicitFractal

Source§

fn set_seed(&mut self, seed: u32)

Source§

fn get_2d(&mut self, x: f64, y: f64) -> f64

Source§

fn get_3d(&mut self, x: f64, y: f64, z: f64) -> f64

Source§

fn get_4d(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source§

fn get_6d(&mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64) -> f64

Source§

fn spacing(&self) -> f64

Source§

fn set_deriv_spacing(&mut self, s: f64)

Source§

fn get_dx_2(&mut self, x: f64, y: f64) -> f64

Source§

fn get_dy_2(&mut self, x: f64, y: f64) -> f64

Source§

fn get_dx_3(&mut self, x: f64, y: f64, z: f64) -> f64

Source§

fn get_dy_3(&mut self, x: f64, y: f64, z: f64) -> f64

Source§

fn get_dz_3(&mut self, x: f64, y: f64, z: f64) -> f64

Source§

fn get_dx_4(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source§

fn get_dy_4(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source§

fn get_dz_4(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source§

fn get_dw_4(&mut self, x: f64, y: f64, z: f64, w: f64) -> f64

Source§

fn get_dx_6(&mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64) -> f64

Source§

fn get_dy_6(&mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64) -> f64

Source§

fn get_dz_6(&mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64) -> f64

Source§

fn get_dw_6(&mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64) -> f64

Source§

fn get_du_6(&mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64) -> f64

Source§

fn get_dv_6(&mut self, x: f64, y: f64, z: f64, w: f64, u: f64, v: f64) -> f64

Auto Trait Implementations§

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.

Source§

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

Source§

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>,

Source§

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.