Skip to main content

SquareCell

Struct SquareCell 

Source
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: I

The least corner of this grid square.

§offset: F

The positive offset from floored to the point in the grid square.

§wrapping: W

Trait Implementations§

Source§

impl<F, I, W> BlendableDomainCell for SquareCell<F, I, W>
where Self: DomainCell,

Source§

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<F: Copy, I: Copy, W: Copy> Copy for SquareCell<F, I, W>

Source§

impl<W: WrappingAmount<IVec2>> DifferentiableCell for SquareCell<Vec2, IVec2, W>

Source§

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>

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

Source§

impl<W: WrappingAmount<IVec3>> DifferentiableCell for SquareCell<Vec3, IVec3, W>

Source§

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>

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

Source§

impl<W: WrappingAmount<IVec3>> DifferentiableCell for SquareCell<Vec3A, IVec3, W>

Source§

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>

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

Source§

impl<W: WrappingAmount<IVec4>> DifferentiableCell for SquareCell<Vec4, IVec4, W>

Source§

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>

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

Source§

impl<W: WrappingAmount<IVec2>> DomainCell for SquareCell<Vec2, IVec2, W>

Source§

type Full = Vec2

The larger/full domain this is a portion of.
Source§

fn rough_id(&self, rng: NoiseRng) -> u32

Identifies this cell roughly from others per rng, roughly meaning the ids are not necessarily unique. Read more
Source§

fn iter_points( &self, rng: NoiseRng, ) -> impl Iterator<Item = CellPoint<Self::Full>>

Iterates all the points relevant to this cell. This could include bounding points, internal points, nearby points, or any other point relevant to the domain cell.
Source§

impl<W: WrappingAmount<IVec3>> DomainCell for SquareCell<Vec3, IVec3, W>

Source§

type Full = Vec3

The larger/full domain this is a portion of.
Source§

fn rough_id(&self, rng: NoiseRng) -> u32

Identifies this cell roughly from others per rng, roughly meaning the ids are not necessarily unique. Read more
Source§

fn iter_points( &self, rng: NoiseRng, ) -> impl Iterator<Item = CellPoint<Self::Full>>

Iterates all the points relevant to this cell. This could include bounding points, internal points, nearby points, or any other point relevant to the domain cell.
Source§

impl<W: WrappingAmount<IVec3>> DomainCell for SquareCell<Vec3A, IVec3, W>

Source§

type Full = Vec3A

The larger/full domain this is a portion of.
Source§

fn rough_id(&self, rng: NoiseRng) -> u32

Identifies this cell roughly from others per rng, roughly meaning the ids are not necessarily unique. Read more
Source§

fn iter_points( &self, rng: NoiseRng, ) -> impl Iterator<Item = CellPoint<Self::Full>>

Iterates all the points relevant to this cell. This could include bounding points, internal points, nearby points, or any other point relevant to the domain cell.
Source§

impl<W: WrappingAmount<IVec4>> DomainCell for SquareCell<Vec4, IVec4, W>

Source§

type Full = Vec4

The larger/full domain this is a portion of.
Source§

fn rough_id(&self, rng: NoiseRng) -> u32

Identifies this cell roughly from others per rng, roughly meaning the ids are not necessarily unique. Read more
Source§

fn iter_points( &self, rng: NoiseRng, ) -> impl Iterator<Item = CellPoint<Self::Full>>

Iterates all the points relevant to this cell. This could include bounding points, internal points, nearby points, or any other point relevant to the domain cell.
Source§

impl<W: WrappingAmount<IVec2>> InterpolatableCell for SquareCell<Vec2, IVec2, W>

Source§

fn interpolate_within<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl Curve<f32>, ) -> T

Interpolates between the bounding CellPoints of this DomainCell according to some Curve.
Source§

impl<W: WrappingAmount<IVec3>> InterpolatableCell for SquareCell<Vec3, IVec3, W>

Source§

fn interpolate_within<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl Curve<f32>, ) -> T

Interpolates between the bounding CellPoints of this DomainCell according to some Curve.
Source§

impl<W: WrappingAmount<IVec3>> InterpolatableCell for SquareCell<Vec3A, IVec3, W>

Source§

fn interpolate_within<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl Curve<f32>, ) -> T

Interpolates between the bounding CellPoints of this DomainCell according to some Curve.
Source§

impl<W: WrappingAmount<IVec4>> InterpolatableCell for SquareCell<Vec4, IVec4, W>

Source§

fn interpolate_within<T: VectorSpace<Scalar = f32>>( &self, rng: NoiseRng, f: impl FnMut(CellPoint<Self::Full>) -> T, curve: &impl Curve<f32>, ) -> T

Interpolates between the bounding CellPoints of this DomainCell according to some Curve.
Source§

impl<F: PartialEq, I: PartialEq, W: PartialEq> PartialEq for SquareCell<F, I, W>

Source§

fn eq(&self, other: &SquareCell<F, I, W>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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,

Source§

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

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>
where I: Freeze, F: Freeze, W: Freeze,

§

impl<F, I, W> RefUnwindSafe for SquareCell<F, I, W>

§

impl<F, I, W> Send for SquareCell<F, I, W>
where I: Send, F: Send, W: Send,

§

impl<F, I, W> Sync for SquareCell<F, I, W>
where I: Sync, F: Sync, W: Sync,

§

impl<F, I, W> Unpin for SquareCell<F, I, W>
where I: Unpin, F: Unpin, W: Unpin,

§

impl<F, I, W> UnsafeUnpin for SquareCell<F, I, W>

§

impl<F, I, W> UnwindSafe for SquareCell<F, I, W>
where I: UnwindSafe, F: UnwindSafe, W: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.