pub struct SquareCell<F, I, W> {
pub floored: I,
pub offset: F,
pub wrapping: W,
}Expand description
Represents a hyper cube of some N dimensions. See also OrthoGrid.
Fields§
§floored: IThe least corner of this grid square.
offset: FThe positive offset from floored to the point in the grid square.
wrapping: WThe WrappingAmount.
Trait Implementations§
Source§impl<F, I, W> BlendableDomainCell for SquareCell<F, I, W>where
Self: DomainCell,
impl<F, I, W> BlendableDomainCell for SquareCell<F, I, W>where
Self: DomainCell,
Source§fn blending_half_radius(&self) -> f32
fn blending_half_radius(&self) -> f32
Returns half how far out to consider blending points.
Too high a value can produce discontinuities.
Source§impl<F: Clone, I: Clone, W: Clone> Clone for SquareCell<F, I, W>
impl<F: Clone, I: Clone, W: Clone> Clone for SquareCell<F, I, W>
Source§fn clone(&self) -> SquareCell<F, I, W>
fn clone(&self) -> SquareCell<F, I, W>
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<F: Copy, I: Copy, W: Copy> Copy for SquareCell<F, I, W>
Source§impl<W: WrappingAmount<IVec2>> DifferentiableCell for SquareCell<Vec2, IVec2, W>
impl<W: WrappingAmount<IVec2>> DifferentiableCell for SquareCell<Vec2, IVec2, W>
Source§type Gradient<D> = [D; 2]
type Gradient<D> = [D; 2]
The gradient vector of derivative elements
D.
This should usually be [D; N] where N is the number of axies.Source§fn interpolation_gradient<T: VectorSpace<Scalar = f32>>(
&self,
rng: NoiseRng,
f: impl FnMut(CellPoint<Self::Full>) -> T,
curve: &impl SampleDerivative<f32>,
gradient_scale: f32,
) -> Self::Gradient<T>
fn interpolation_gradient<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl SampleDerivative<f32>, gradient_scale: f32, ) -> Self::Gradient<T>
Calculates the
Gradient vector for the function interpolate_within.Source§fn interpolate_with_gradient<T: VectorSpace<Scalar = f32>>(
&self,
rng: NoiseRng,
f: impl FnMut(CellPoint<Self::Full>) -> T,
curve: &impl SampleDerivative<f32>,
gradient_scale: f32,
) -> WithGradient<T, Self::Gradient<T>>
fn interpolate_with_gradient<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl SampleDerivative<f32>, gradient_scale: f32, ) -> WithGradient<T, Self::Gradient<T>>
Combines
interpolate_within and interpolation_gradient.Source§impl<W: WrappingAmount<IVec3>> DifferentiableCell for SquareCell<Vec3, IVec3, W>
impl<W: WrappingAmount<IVec3>> DifferentiableCell for SquareCell<Vec3, IVec3, W>
Source§type Gradient<D> = [D; 3]
type Gradient<D> = [D; 3]
The gradient vector of derivative elements
D.
This should usually be [D; N] where N is the number of axies.Source§fn interpolation_gradient<T: VectorSpace<Scalar = f32>>(
&self,
rng: NoiseRng,
f: impl FnMut(CellPoint<Self::Full>) -> T,
curve: &impl SampleDerivative<f32>,
gradient_scale: f32,
) -> Self::Gradient<T>
fn interpolation_gradient<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl SampleDerivative<f32>, gradient_scale: f32, ) -> Self::Gradient<T>
Calculates the
Gradient vector for the function interpolate_within.Source§fn interpolate_with_gradient<T: VectorSpace<Scalar = f32>>(
&self,
rng: NoiseRng,
f: impl FnMut(CellPoint<Self::Full>) -> T,
curve: &impl SampleDerivative<f32>,
gradient_scale: f32,
) -> WithGradient<T, Self::Gradient<T>>
fn interpolate_with_gradient<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl SampleDerivative<f32>, gradient_scale: f32, ) -> WithGradient<T, Self::Gradient<T>>
Combines
interpolate_within and interpolation_gradient.Source§impl<W: WrappingAmount<IVec3>> DifferentiableCell for SquareCell<Vec3A, IVec3, W>
impl<W: WrappingAmount<IVec3>> DifferentiableCell for SquareCell<Vec3A, IVec3, W>
Source§type Gradient<D> = [D; 3]
type Gradient<D> = [D; 3]
The gradient vector of derivative elements
D.
This should usually be [D; N] where N is the number of axies.Source§fn interpolation_gradient<T: VectorSpace<Scalar = f32>>(
&self,
rng: NoiseRng,
f: impl FnMut(CellPoint<Self::Full>) -> T,
curve: &impl SampleDerivative<f32>,
gradient_scale: f32,
) -> Self::Gradient<T>
fn interpolation_gradient<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl SampleDerivative<f32>, gradient_scale: f32, ) -> Self::Gradient<T>
Calculates the
Gradient vector for the function interpolate_within.Source§fn interpolate_with_gradient<T: VectorSpace<Scalar = f32>>(
&self,
rng: NoiseRng,
f: impl FnMut(CellPoint<Self::Full>) -> T,
curve: &impl SampleDerivative<f32>,
gradient_scale: f32,
) -> WithGradient<T, Self::Gradient<T>>
fn interpolate_with_gradient<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl SampleDerivative<f32>, gradient_scale: f32, ) -> WithGradient<T, Self::Gradient<T>>
Combines
interpolate_within and interpolation_gradient.Source§impl<W: WrappingAmount<IVec4>> DifferentiableCell for SquareCell<Vec4, IVec4, W>
impl<W: WrappingAmount<IVec4>> DifferentiableCell for SquareCell<Vec4, IVec4, W>
Source§type Gradient<D> = [D; 4]
type Gradient<D> = [D; 4]
The gradient vector of derivative elements
D.
This should usually be [D; N] where N is the number of axies.Source§fn interpolation_gradient<T: VectorSpace<Scalar = f32>>(
&self,
rng: NoiseRng,
f: impl FnMut(CellPoint<Self::Full>) -> T,
curve: &impl SampleDerivative<f32>,
gradient_scale: f32,
) -> Self::Gradient<T>
fn interpolation_gradient<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl SampleDerivative<f32>, gradient_scale: f32, ) -> Self::Gradient<T>
Calculates the
Gradient vector for the function interpolate_within.Source§fn interpolate_with_gradient<T: VectorSpace<Scalar = f32>>(
&self,
rng: NoiseRng,
f: impl FnMut(CellPoint<Self::Full>) -> T,
curve: &impl SampleDerivative<f32>,
gradient_scale: f32,
) -> WithGradient<T, Self::Gradient<T>>
fn interpolate_with_gradient<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl SampleDerivative<f32>, gradient_scale: f32, ) -> WithGradient<T, Self::Gradient<T>>
Combines
interpolate_within and interpolation_gradient.Source§impl<W: WrappingAmount<IVec2>> DomainCell for SquareCell<Vec2, IVec2, W>
impl<W: WrappingAmount<IVec2>> DomainCell for SquareCell<Vec2, IVec2, W>
Source§impl<W: WrappingAmount<IVec3>> DomainCell for SquareCell<Vec3, IVec3, W>
impl<W: WrappingAmount<IVec3>> DomainCell for SquareCell<Vec3, IVec3, W>
Source§impl<W: WrappingAmount<IVec3>> DomainCell for SquareCell<Vec3A, IVec3, W>
impl<W: WrappingAmount<IVec3>> DomainCell for SquareCell<Vec3A, IVec3, W>
Source§impl<W: WrappingAmount<IVec4>> DomainCell for SquareCell<Vec4, IVec4, W>
impl<W: WrappingAmount<IVec4>> DomainCell for SquareCell<Vec4, IVec4, W>
Source§impl<W: WrappingAmount<IVec2>> InterpolatableCell for SquareCell<Vec2, IVec2, W>
impl<W: WrappingAmount<IVec2>> InterpolatableCell for SquareCell<Vec2, IVec2, W>
Source§impl<W: WrappingAmount<IVec3>> InterpolatableCell for SquareCell<Vec3, IVec3, W>
impl<W: WrappingAmount<IVec3>> InterpolatableCell for SquareCell<Vec3, IVec3, W>
Source§impl<W: WrappingAmount<IVec3>> InterpolatableCell for SquareCell<Vec3A, IVec3, W>
impl<W: WrappingAmount<IVec3>> InterpolatableCell for SquareCell<Vec3A, IVec3, W>
Source§impl<W: WrappingAmount<IVec4>> InterpolatableCell for SquareCell<Vec4, IVec4, W>
impl<W: WrappingAmount<IVec4>> InterpolatableCell for SquareCell<Vec4, IVec4, W>
Source§impl<F: PartialEq, I: PartialEq, W: PartialEq> PartialEq for SquareCell<F, I, W>
impl<F: PartialEq, I: PartialEq, W: PartialEq> PartialEq for SquareCell<F, I, W>
Source§fn eq(&self, other: &SquareCell<F, I, W>) -> bool
fn eq(&self, other: &SquareCell<F, I, W>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<F: PartialEq, I: PartialEq, W: PartialEq> StructuralPartialEq for SquareCell<F, I, W>
Source§impl<F, I, W> WorleyDomainCell for SquareCell<F, I, W>where
Self: DomainCell,
impl<F, I, W> WorleyDomainCell for SquareCell<F, I, W>where
Self: DomainCell,
Source§fn next_nearest_1d_point_always_within(&self) -> f32
fn next_nearest_1d_point_always_within(&self) -> f32
For every
CellPoint::offset produced by DomainCell::iter_points, the second nearest point along each axis will be less than this far away along that axis.Source§fn nearest_1d_point_always_within(&self) -> f32
fn nearest_1d_point_always_within(&self) -> f32
For every
CellPoint::offset produced by DomainCell::iter_points, the nearest point along each axis will be less than this far away along that axis.Auto Trait Implementations§
impl<F, I, W> Freeze for SquareCell<F, I, W>
impl<F, I, W> RefUnwindSafe for SquareCell<F, I, W>
impl<F, I, W> Send for SquareCell<F, I, W>
impl<F, I, W> Sync for SquareCell<F, I, W>
impl<F, I, W> Unpin for SquareCell<F, I, W>
impl<F, I, W> UnsafeUnpin for SquareCell<F, I, W>
impl<F, I, W> UnwindSafe for SquareCell<F, I, W>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more