Expand description
The data structure this crate revoles around.
Implementations
sourceimpl<'a, A: Axis, T: Aabb> DinoTree<'a, A, T>
impl<'a, A: Axis, T: Aabb> DinoTree<'a, A, T>
sourcepub fn with_axis(axis: A, bots: &'a mut [T]) -> DinoTree<'a, A, T>
pub fn with_axis(axis: A, bots: &'a mut [T]) -> DinoTree<'a, A, T>
Examples
let mut bots = [axgeom::rect(0,10,0,10)];
let tree = dinotree_alg::DinoTree::with_axis(axgeom::XAXIS,&mut bots);
sourceimpl<'a, A: Axis, T: Aabb + Send + Sync> DinoTree<'a, A, T>
impl<'a, A: Axis, T: Aabb + Send + Sync> DinoTree<'a, A, T>
sourcepub fn with_axis_par(axis: A, bots: &'a mut [T]) -> DinoTree<'a, A, T>
pub fn with_axis_par(axis: A, bots: &'a mut [T]) -> DinoTree<'a, A, T>
Examples
let mut bots = [axgeom::rect(0,10,0,10)];
let tree = dinotree_alg::DinoTree::with_axis(axgeom::XAXIS,&mut bots);
sourceimpl<'a, A: Axis, T: Aabb> DinoTree<'a, A, T>
impl<'a, A: Axis, T: Aabb> DinoTree<'a, A, T>
sourcepub fn get_height(&self) -> usize
pub fn get_height(&self) -> usize
Examples
use dinotree_alg::*;
let mut bots = vec![axgeom::rect(0,10,0,10);400];
let mut tree = DinoTree::new(&mut bots);
assert_eq!(tree.get_height(),analyze::compute_tree_height_heuristic(400,analyze::DEFAULT_NUMBER_ELEM_PER_NODE));Trait Implementations
sourceimpl<'a, A: Axis, T: Aabb> Queries<'a> for DinoTree<'a, A, T>
impl<'a, A: Axis, T: Aabb> Queries<'a> for DinoTree<'a, A, T>
TODO use this insead
type A = A
type T = T
type Num = T::Num
fn new_colfind_builder(
&mut self
) -> QueryBuilder<'_, Self::A, NodeMut<'a, Self::T>>
sourcefn draw_divider(
&self,
drawer: &mut impl DividerDrawer<N = Self::Num>,
rect: &Rect<Self::Num>
)
fn draw_divider(
&self,
drawer: &mut impl DividerDrawer<N = Self::Num>,
rect: &Rect<Self::Num>
)
Examples Read more
sourcefn find_intersections_pmut(
&mut self,
func: impl FnMut(PMut<'_, Self::T>, PMut<'_, Self::T>)
)
fn find_intersections_pmut(
&mut self,
func: impl FnMut(PMut<'_, Self::T>, PMut<'_, Self::T>)
)
Find all aabb intersections and return a PMutfind_intersections_mut, this allows the
user to access a read only reference of the AABB. Read more
sourcefn multi_rect(&mut self) -> MultiRectMut<'_, Self::A, NodeMut<'a, Self::T>>
fn multi_rect(&mut self) -> MultiRectMut<'_, Self::A, NodeMut<'a, Self::T>>
Examples Read more
sourcefn for_all_intersect_rect<'b>(
&'b self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b Self::T)
) where
'a: 'b,
fn for_all_intersect_rect<'b>(
&'b self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b Self::T)
) where
'a: 'b,
Examples Read more
sourcefn for_all_in_rect<'b>(
&'b self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b Self::T)
) where
'a: 'b,
fn for_all_in_rect<'b>(
&'b self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b Self::T)
) where
'a: 'b,
Examples Read more
fn nbody_mut<X: NodeMassTrait<Num = Self::Num, Item = Self::T> + Send + Sync>(
&mut self,
ncontext: &X,
rect: Rect<Self::Num>
) where
X::No: Send,
Self::T: HasInner + Send + Sync,
fn nbody_mut_par<X: NodeMassTrait<Num = Self::Num, Item = Self::T> + Sync + Send>(
&mut self,
ncontext: &X,
rect: Rect<Self::Num>
) where
X::No: Send,
Self::T: HasInner + Send + Sync,
sourceimpl<'a, A: Axis, T: Aabb + HasInner> QueriesInner<'a> for DinoTree<'a, A, T>
impl<'a, A: Axis, T: Aabb + HasInner> QueriesInner<'a> for DinoTree<'a, A, T>
type Inner = T::Inner
sourcefn find_intersections_mut(
&mut self,
func: impl FnMut(&mut Self::Inner, &mut Self::Inner)
)
fn find_intersections_mut(
&mut self,
func: impl FnMut(&mut Self::Inner, &mut Self::Inner)
)
Find all aabb intersections Read more
sourcefn find_intersections_mut_par(
&mut self,
func: impl Fn(&mut Self::Inner, &mut Self::Inner) + Clone + Send + Sync
) where
Self::T: Send + Sync,
fn find_intersections_mut_par(
&mut self,
func: impl Fn(&mut Self::Inner, &mut Self::Inner) + Clone + Send + Sync
) where
Self::T: Send + Sync,
Find all intersections in parallel Read more
sourcefn find_intersections_par_ext<B: Send + Sync>(
&mut self,
split: impl Fn(&mut B) -> B + Send + Sync + Copy,
fold: impl Fn(&mut B, B) + Send + Sync + Copy,
collision: impl Fn(&mut B, &mut Self::Inner, &mut Self::Inner) + Send + Sync + Copy,
acc: B
) -> B where
Self::T: Send + Sync,
fn find_intersections_par_ext<B: Send + Sync>(
&mut self,
split: impl Fn(&mut B) -> B + Send + Sync + Copy,
fold: impl Fn(&mut B, B) + Send + Sync + Copy,
collision: impl Fn(&mut B, &mut Self::Inner, &mut Self::Inner) + Send + Sync + Copy,
acc: B
) -> B where
Self::T: Send + Sync,
Allows the user to potentially collect some aspect of every intersection in parallel. Read more
sourcefn for_all_not_in_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
fn for_all_not_in_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
Examples Read more
sourcefn for_all_intersect_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
fn for_all_intersect_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
Examples Read more
sourcefn for_all_in_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
fn for_all_in_rect_mut<'b>(
&'b mut self,
rect: &Rect<Self::Num>,
func: impl FnMut(&'b mut Self::Inner)
) where
'a: 'b,
Examples Read more
sourcefn raycast_mut<'b, Acc>(
&'b mut self,
ray: Ray<Self::Num>,
start: &mut Acc,
broad: impl FnMut(&mut Acc, &Ray<Self::Num>, &Rect<Self::Num>) -> CastResult<Self::Num>,
fine: impl FnMut(&mut Acc, &Ray<Self::Num>, &Self::T) -> CastResult<Self::Num>,
border: Rect<Self::Num>
) -> RayCastResult<'b, Self::Inner, Self::Num> where
'a: 'b,
fn raycast_mut<'b, Acc>(
&'b mut self,
ray: Ray<Self::Num>,
start: &mut Acc,
broad: impl FnMut(&mut Acc, &Ray<Self::Num>, &Rect<Self::Num>) -> CastResult<Self::Num>,
fine: impl FnMut(&mut Acc, &Ray<Self::Num>, &Self::T) -> CastResult<Self::Num>,
border: Rect<Self::Num>
) -> RayCastResult<'b, Self::Inner, Self::Num> where
'a: 'b,
Examples Read more
sourcefn k_nearest_mut<'b, Acc>(
&'b mut self,
point: Vec2<Self::Num>,
num: usize,
start: &mut Acc,
broad: impl FnMut(&mut Acc, Vec2<Self::Num>, &Rect<Self::Num>) -> Self::Num,
fine: impl FnMut(&mut Acc, Vec2<Self::Num>, &Self::T) -> Self::Num,
border: Rect<Self::Num>
) -> Vec<KnearestResult<'b, Self::Inner, Self::Num>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator, where
'a: 'b,
fn k_nearest_mut<'b, Acc>(
&'b mut self,
point: Vec2<Self::Num>,
num: usize,
start: &mut Acc,
broad: impl FnMut(&mut Acc, Vec2<Self::Num>, &Rect<Self::Num>) -> Self::Num,
fine: impl FnMut(&mut Acc, Vec2<Self::Num>, &Self::T) -> Self::Num,
border: Rect<Self::Num>
) -> Vec<KnearestResult<'b, Self::Inner, Self::Num>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator, where
'a: 'b,
A: Allocator,
Examples Read more
Auto Trait Implementations
impl<'a, A, T> RefUnwindSafe for DinoTree<'a, A, T> where
A: RefUnwindSafe,
T: RefUnwindSafe,
<T as Aabb>::Num: RefUnwindSafe,
impl<'a, A, T> Send for DinoTree<'a, A, T> where
T: Send,
impl<'a, A, T> Sync for DinoTree<'a, A, T> where
T: Sync,
impl<'a, A, T> Unpin for DinoTree<'a, A, T> where
A: Unpin,
<T as Aabb>::Num: Unpin,
impl<'a, A, T> !UnwindSafe for DinoTree<'a, A, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more