pub struct DynamicTree<T: Clone> { /* private fields */ }Expand description
A dynamic AABB tree for efficient spatial queries.
Implementations§
Source§impl<T: Clone> DynamicTree<T>
impl<T: Clone> DynamicTree<T>
Sourcepub fn insert(&mut self, aabb: Aabb, user_data: T) -> i32
pub fn insert(&mut self, aabb: Aabb, user_data: T) -> i32
Inserts a new leaf into the tree and returns its index.
Sourcepub fn update(
&mut self,
leaf: i32,
aabb: Aabb,
displacement: Vec3,
force_update: bool,
) -> bool
pub fn update( &mut self, leaf: i32, aabb: Aabb, displacement: Vec3, force_update: bool, ) -> bool
Updates a leaf with a new AABB. If the new AABB is still within the “fat” AABB, no tree update is needed.
Sourcepub fn get_user_data(&self, leaf: i32) -> &T
pub fn get_user_data(&self, leaf: i32) -> &T
Returns the user data for a given leaf.
Sourcepub fn query_pairs<F>(&self, callback: F)
pub fn query_pairs<F>(&self, callback: F)
Queries the tree for all pairs of overlapping leaves.
Trait Implementations§
Source§impl<T: Clone + Clone> Clone for DynamicTree<T>
impl<T: Clone + Clone> Clone for DynamicTree<T>
Source§fn clone(&self) -> DynamicTree<T>
fn clone(&self) -> DynamicTree<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for DynamicTree<T>
impl<T> RefUnwindSafe for DynamicTree<T>where
T: RefUnwindSafe,
impl<T> Send for DynamicTree<T>where
T: Send,
impl<T> Sync for DynamicTree<T>where
T: Sync,
impl<T> Unpin for DynamicTree<T>where
T: Unpin,
impl<T> UnwindSafe for DynamicTree<T>where
T: 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