pub trait SpatialIndex<T: Clone> {
// Required methods
fn insert(&mut self, pos: Vec3, item: T);
fn query_radius(&self, center: Vec3, radius: f32) -> Vec<(T, Vec3, f32)>;
fn k_nearest(&self, center: Vec3, k: usize) -> Vec<(T, Vec3, f32)>;
fn clear(&mut self);
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Common interface for spatial acceleration structures.
Required Methods§
Sourcefn query_radius(&self, center: Vec3, radius: f32) -> Vec<(T, Vec3, f32)>
fn query_radius(&self, center: Vec3, radius: f32) -> Vec<(T, Vec3, f32)>
Query all items within radius of center.