Struct ReducedUniformPoint

Source
pub struct ReducedUniformPoint<P, const SIZE: u8, const SALT: u64> {
    pub points: ArrayVec<P, 7>,
}
Expand description

Removes locations that are too close to others.

Fields§

§points: ArrayVec<P, 7>

The points remaining after removing ones that are too close to others.

Trait Implementations§

Source§

impl<P: Reducible, const SIZE: u8, const SALT: u64> Chunk for ReducedUniformPoint<P, SIZE, SALT>

Source§

const SIZE: Point2d<u8>

Width and height of the chunk (in powers of two);
Source§

type LayerStore<T> = Arc<T>

Data structure that stores the layer. Usually Arc<Self>, but some layers are only used to simplify another layer, so they can get stored directly without the Arc indirection.
Source§

type Dependencies = Layer<UniformPoint<P, SIZE, SALT>>

The actual dependencies. Usually a struct with fields of Layer<T> type, but can be of any type to specify non-layer dependencies, too. It is the type of the first argument of Chunk::compute.
Source§

fn compute(raw_points: &Self::Dependencies, index: GridPoint<Self>) -> Self

Compute a chunk from its dependencies
Source§

fn clear(raw_points: &Self::Dependencies, index: GridPoint<Self>)

Clear all information that [compute] would have computed
Source§

const GRID_SIZE: Point2d<u8> = _

Exponent of 2 of the cached area (in grid chunk numbers, not world coordinates). This is the area that should stay in memory at all times as it will get requested a lot.
Source§

const GRID_OVERLAP: u8 = 3u8

Internal RollingGrid overlap before the system drops old chunks. Basically scales the grid width/height by this number to allow moving across the grid width/height boundaries completely transparently. Increasing this number makes indexing the RollingGrid more expensive if there is a lot of overlap.
Source§

fn bounds(index: GridPoint<Self>) -> Bounds

Get the bounds for the chunk at the given index
Source§

fn bounds_to_grid(bounds: Bounds) -> Bounds<GridIndex<Self>>

Get the grids that are touched by the given bounds.
Source§

fn pos_to_grid(point: Point2d) -> GridPoint<Self>

Get the grid the position is in
Source§

fn vision_range(bounds: Bounds) -> Bounds

Pad by a chunk size to make sure we see effects from the neighboring chunks
Source§

fn moore_neighborhood(index: GridPoint<Self>) -> [[GridPoint<Self>; 3]; 3]

Get 3x3 grid points around a central one
Source§

impl<P: Clone, const SIZE: u8, const SALT: u64> Clone for ReducedUniformPoint<P, SIZE, SALT>

Source§

fn clone(&self) -> ReducedUniformPoint<P, SIZE, SALT>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug, const SIZE: u8, const SALT: u64> Debug for ReducedUniformPoint<P, SIZE, SALT>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: Reducible, const SIZE: u8, const SALT: u64> Debug for ReducedUniformPoint<P, SIZE, SALT>

Source§

fn debug(&self) -> Vec<DebugContent>

Render the elements of this chunk type.
Source§

impl<P, const SIZE: u8, const SALT: u64> Default for ReducedUniformPoint<P, SIZE, SALT>

Source§

fn default() -> Self

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

impl<P: PartialEq, const SIZE: u8, const SALT: u64> PartialEq for ReducedUniformPoint<P, SIZE, SALT>

Source§

fn eq(&self, other: &ReducedUniformPoint<P, SIZE, SALT>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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<P, const SIZE: u8, const SALT: u64> StructuralPartialEq for ReducedUniformPoint<P, SIZE, SALT>

Auto Trait Implementations§

§

impl<P, const SIZE: u8, const SALT: u64> Freeze for ReducedUniformPoint<P, SIZE, SALT>
where P: Freeze,

§

impl<P, const SIZE: u8, const SALT: u64> RefUnwindSafe for ReducedUniformPoint<P, SIZE, SALT>
where P: RefUnwindSafe,

§

impl<P, const SIZE: u8, const SALT: u64> Send for ReducedUniformPoint<P, SIZE, SALT>
where P: Send,

§

impl<P, const SIZE: u8, const SALT: u64> Sync for ReducedUniformPoint<P, SIZE, SALT>
where P: Sync,

§

impl<P, const SIZE: u8, const SALT: u64> Unpin for ReducedUniformPoint<P, SIZE, SALT>
where P: Unpin,

§

impl<P, const SIZE: u8, const SALT: u64> UnwindSafe for ReducedUniformPoint<P, SIZE, SALT>
where P: 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> 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> 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.