pub struct KDTree2<Comp> {
pub tree: BaseKdTree<Point2>,
/* private fields */
}Expand description
Resource for storing a KdTree
Fields§
§tree: BaseKdTree<Point2>The KdTree
Trait Implementations§
Source§impl<Comp> SpatialAccess for KDTree2<Comp>where
Comp: TComp,
impl<Comp> SpatialAccess for KDTree2<Comp>where
Comp: TComp,
Source§fn nearest_neighbour(
&self,
loc: <Point2 as SpatialPoint>::Vec,
) -> Option<Self::ResultT>
fn nearest_neighbour( &self, loc: <Point2 as SpatialPoint>::Vec, ) -> Option<Self::ResultT>
Get the nearest neighbour to a position.
Source§fn k_nearest_neighbour(
&self,
loc: <Point2 as SpatialPoint>::Vec,
k: usize,
) -> Vec<Self::ResultT>
fn k_nearest_neighbour( &self, loc: <Point2 as SpatialPoint>::Vec, k: usize, ) -> Vec<Self::ResultT>
Get the k neighbours to loc
If loc is the location of a tracked entity, you might want to skip the first.
Source§fn within_distance(
&self,
loc: <Point2 as SpatialPoint>::Vec,
distance: <Point2 as SpatialPoint>::Scalar,
) -> Vec<Self::ResultT>
fn within_distance( &self, loc: <Point2 as SpatialPoint>::Vec, distance: <Point2 as SpatialPoint>::Scalar, ) -> Vec<Self::ResultT>
Get all entities within a certain distance (radius) of loc
Source§type Point = Point2
type Point = Point2
The point type, can be anything implementing
SpatialPoint.impl<Comp> Resource for KDTree2<Comp>
Auto Trait Implementations§
impl<Comp> Freeze for KDTree2<Comp>
impl<Comp> RefUnwindSafe for KDTree2<Comp>where
Comp: RefUnwindSafe,
impl<Comp> Send for KDTree2<Comp>where
Comp: Send,
impl<Comp> Sync for KDTree2<Comp>where
Comp: Sync,
impl<Comp> Unpin for KDTree2<Comp>where
Comp: Unpin,
impl<Comp> UnwindSafe for KDTree2<Comp>where
Comp: 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
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> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
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