[][src]Struct arcs::components::Space

pub struct Space { /* fields omitted */ }

A global Resource for looking up which Entitys inhabit a given spatial point or region

Methods

impl Space[src]

pub const WORLD_RADIUS: f64[src]

pub fn modify(&mut self, spatial: SpatialEntity)[src]

Modifies the spatial position of the given SpatialEntity inside of Space If the SpatialEntity is not already inside of Space it will be inserted.

pub fn remove(&mut self, entity: Entity)[src]

Removes the given Entity from this Space

pub fn remove_by_id(&mut self, id: Index)[src]

Removes an Entity from this Space given its Index

pub fn iter<'this>(&'this self) -> impl Iterator<Item = SpatialEntity> + 'this[src]

Returns an iterator over all SpatialEntity in this Space

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

pub fn query_point<'this>(
    &'this self,
    point: Point,
    radius: f64
) -> impl Iterator<Item = SpatialEntity> + 'this
[src]

Performs a spatial query in an radius around a given Point Returns an iterator with all SpatialEntity inhabiting the Space close to the given point The returned iterator can be empty

pub fn query_region<'this>(
    &'this self,
    region: BoundingBox
) -> impl Iterator<Item = SpatialEntity> + 'this
[src]

Performs a spatial query for a given BoundingBox Returns an iterator with all SpatialEntity inhabiting the Space of the given BoundingBox The returned iterator can be empty

pub fn clear(&mut self)[src]

Clears the Space of all SpatialEntity

pub fn resize(&mut self, size: impl Spatial<f64>)[src]

Resizes the inner quadtree to the given bigger size

Panics

Panics if the size given is not bigger then the initial bounding_box of the Space

Trait Implementations

impl Debug for Space[src]

impl Default for Space[src]

Auto Trait Implementations

impl RefUnwindSafe for Space

impl Send for Space

impl Sync for Space

impl Unpin for Space

impl UnwindSafe for Space

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> RoundFrom<T> for T[src]

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 
[src]

impl<T> TryDefault for T where
    T: Default
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.