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>
impl<P: Reducible, const SIZE: u8, const SALT: u64> Chunk for ReducedUniformPoint<P, SIZE, SALT>
Source§type LayerStore<T> = Arc<T>
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>>
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
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>)
fn clear(raw_points: &Self::Dependencies, index: GridPoint<Self>)
Clear all information that [compute] would have computed
Source§const GRID_SIZE: Point2d<u8> = _
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
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_to_grid(bounds: Bounds) -> Bounds<GridIndex<Self>>
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>
fn pos_to_grid(point: Point2d) -> GridPoint<Self>
Get the grid the position is in
Source§fn vision_range(bounds: Bounds) -> Bounds
fn vision_range(bounds: Bounds) -> Bounds
Pad by a chunk size to make sure we see effects from the neighboring chunks
Source§impl<P: Clone, const SIZE: u8, const SALT: u64> Clone for ReducedUniformPoint<P, SIZE, SALT>
impl<P: Clone, const SIZE: u8, const SALT: u64> Clone for ReducedUniformPoint<P, SIZE, SALT>
Source§fn clone(&self) -> ReducedUniformPoint<P, SIZE, SALT>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<P: Reducible, const SIZE: u8, const SALT: u64> Debug for ReducedUniformPoint<P, SIZE, SALT>
impl<P: Reducible, const SIZE: u8, const SALT: u64> Debug for ReducedUniformPoint<P, SIZE, SALT>
Source§fn debug(&self) -> Vec<DebugContent>
fn debug(&self) -> Vec<DebugContent>
Render the elements of this chunk type.
Source§impl<P: PartialEq, const SIZE: u8, const SALT: u64> PartialEq for ReducedUniformPoint<P, SIZE, SALT>
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
fn eq(&self, other: &ReducedUniformPoint<P, SIZE, SALT>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.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> 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