pub struct Grid<const D: usize, A: Arch = StaticArch> { /* private fields */ }Expand description
Implementations§
Source§impl<A: Arch> Grid<2, A>
impl<A: Arch> Grid<2, A>
Sourcepub fn new(x: usize, y: usize) -> Self
pub fn new(x: usize, y: usize) -> Self
Creates an anchor for a grid region that can be used for call noise.
§Parameters
-x: Length of the grid region along the x-axis
-y: Length of the grid region along the y-axis
Sourcepub fn grid_position(self, x: f64, y: f64) -> Self
pub fn grid_position(self, x: f64, y: f64) -> Self
Determines the position values provided to noise calls. This value represents
the position of this grid region in grid units determined by its grid_size.
A 32x32 grid at position { 1, 2 } covers samples in the range { 32..64, 64..96 }.
§Default:
0.0: x
0.0: y
Sourcepub fn sample_position(self, x: f64, y: f64) -> Self
pub fn sample_position(self, x: f64, y: f64) -> Self
Determines the position values provided to noise calls. This value represents
the position of first sample in each dimension. A 32x32 given the sample position
{ 32, 16 } covers samples in the range { 32..64, 16..48 }.
§Default:
0.0: x
0.0: y
Source§impl<A: Arch> Grid<3, A>
impl<A: Arch> Grid<3, A>
Sourcepub fn new(x: usize, y: usize, z: usize) -> Self
pub fn new(x: usize, y: usize, z: usize) -> Self
Creates an anchor for a grid region that can be used for call noise.
§Parameters
-x: Length of the grid region along the x-axis
-y: Length of the grid region along the y-axis
-z: Length of the grid region along the z-axis
Sourcepub fn grid_position(self, x: f64, y: f64, z: f64) -> Self
pub fn grid_position(self, x: f64, y: f64, z: f64) -> Self
Determines the position values provided to noise calls. This value represents
the position of this grid region in grid units determined by its grid_size.
A 32x32x32 grid at position { 1, 2, 3 } covers samples in the range
{ 32..64, 64..96, 96..128 }.
§Default:
0.0: x
0.0: y
0.0: z
Sourcepub fn sample_position(self, x: f64, y: f64, z: f64) -> Self
pub fn sample_position(self, x: f64, y: f64, z: f64) -> Self
Determines the position values provided to noise calls. This value represents
the position of first sample in each dimension. A 32x32x32 given the sample position
{ 32, 16, 0 } covers samples in the range { 32..64, 16..48, 0..32 }.
§Default:
0.0: x
0.0: y
0.0: z
Source§impl<const D: usize, A: Arch> Grid<D, A>
impl<const D: usize, A: Arch> Grid<D, A>
Sourcepub fn from_config(config: GridConfig<D>) -> Self
pub fn from_config(config: GridConfig<D>) -> Self
Loads a config a config to create a grid.
Sourcepub fn builder<C: Combiner, G: GridGenerator<D>>(
&self,
) -> GridNoiseBuilder<D, C, G, A>
pub fn builder<C: Combiner, G: GridGenerator<D>>( &self, ) -> GridNoiseBuilder<D, C, G, A>
Creates a new builder to easily configure a grid region of noise.
§Type Parameters
C: The algorithm to combine separate noise passes (octaves) together.G: The algorithm to sample noise with.
Sourcepub fn builder_with_octaves<'a, C: Combiner, G: GridGenerator<D>>(
&self,
octave_list: &'a [Octave<D>],
) -> OctaveGridNoiseBuilder<'a, D, C, G, A>
pub fn builder_with_octaves<'a, C: Combiner, G: GridGenerator<D>>( &self, octave_list: &'a [Octave<D>], ) -> OctaveGridNoiseBuilder<'a, D, C, G, A>
Creates a new builder using a custom octave list to configure a grid region of noise.
§Type Parameters
C: The algorithm to combine separate noise passes (octaves) together.G: The algorithm to sample noise with.
Source§impl<A: Arch> Grid<3, A>
impl<A: Arch> Grid<3, A>
Source§impl<A: Arch> Grid<2, A>
Creates a builder struct for warping noise.
impl<A: Arch> Grid<2, A>
Creates a builder struct for warping noise.
§Type Parameters
C: The combiner algorithm to use across octaves.G: The generator algorithm to sample from.
§Parameters
warp_strength: How strongly the warp is applied.x_iter: An iterator of warp values to distort each sample’s x input.y_iter: An iterator of warp values to distort each sample’s y input.
pub fn warp_builder<C: Combiner, G: BatchGenerator<2>>( &self, warp_strength: f32, x_iter: impl Iterator<Item = Simd<f32, A>>, y_iter: impl Iterator<Item = Simd<f32, A>>, ) -> BatchNoiseBuilder<2, C, G, A, impl DimIter<A, 2>>
Source§impl<A: Arch> Grid<3, A>
Creates a builder struct for warping noise.
impl<A: Arch> Grid<3, A>
Creates a builder struct for warping noise.
§Type Parameters
C: The combiner algorithm to use across octaves.G: The generator algorithm to sample from.
§Parameters
warp_strength: How strongly the warp is applied.x_iter: An iterator of warp values to distort each sample’s x input.y_iter: An iterator of warp values to distort each sample’s y input.z_iter: An iterator of warp values to distort each sample’s z input.