pub struct DBVT<N: RealField + Copy, T, BV> { /* private fields */ }
Expand description
A bounding volume hierarchy on which objects can be added or removed after construction.
Implementations§
Source§impl<N: RealField + Copy, T, BV: BoundingVolume<N>> DBVT<N, T, BV>
impl<N: RealField + Copy, T, BV: BoundingVolume<N>> DBVT<N, T, BV>
Sourcepub fn root_bounding_volume(&self) -> Option<&BV>
pub fn root_bounding_volume(&self) -> Option<&BV>
The bounding volume of the root of this DBVT.
Returns None
if the DBVT is empty.
Sourcepub fn insert(&mut self, leaf: DBVTLeaf<N, T, BV>) -> DBVTLeafId
pub fn insert(&mut self, leaf: DBVTLeaf<N, T, BV>) -> DBVTLeafId
Inserts a leaf into this DBVT.
Sourcepub fn remove(&mut self, leaf_id: DBVTLeafId) -> DBVTLeaf<N, T, BV>
pub fn remove(&mut self, leaf_id: DBVTLeafId) -> DBVTLeaf<N, T, BV>
Removes a leaf from this DBVT.
Panics if the provided leaf is not attached to this DBVT.
Sourcepub fn get(&self, DBVTLeafId: DBVTLeafId) -> Option<&DBVTLeaf<N, T, BV>>
pub fn get(&self, DBVTLeafId: DBVTLeafId) -> Option<&DBVTLeaf<N, T, BV>>
Gets the given leaf if it exists.
Trait Implementations§
Source§impl<'a, N: RealField + Copy, T, BV> BVH<T, BV> for DBVT<N, T, BV>
impl<'a, N: RealField + Copy, T, BV> BVH<T, BV> for DBVT<N, T, BV>
Source§type Node = DBVTNodeId
type Node = DBVTNodeId
Type of a node identifiers on this BVH.
Source§fn num_children(&self, node: Self::Node) -> usize
fn num_children(&self, node: Self::Node) -> usize
The number of children of the given node.
Source§fn content(&self, node: Self::Node) -> (&BV, Option<&T>)
fn content(&self, node: Self::Node) -> (&BV, Option<&T>)
The bounding volume and data contained by the given node.
Source§fn visit_bvtt(
&self,
other: &impl BVH<T, BV>,
visitor: &mut impl SimultaneousVisitor<T, BV>,
)
fn visit_bvtt( &self, other: &impl BVH<T, BV>, visitor: &mut impl SimultaneousVisitor<T, BV>, )
Visits the bounding volume test tree implicitly formed with
other
.Auto Trait Implementations§
impl<N, T, BV> Freeze for DBVT<N, T, BV>
impl<N, T, BV> RefUnwindSafe for DBVT<N, T, BV>
impl<N, T, BV> Send for DBVT<N, T, BV>
impl<N, T, BV> Sync for DBVT<N, T, BV>
impl<N, T, BV> Unpin for DBVT<N, T, BV>
impl<N, T, BV> UnwindSafe for DBVT<N, T, BV>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<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>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
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)
Convert
&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)
Convert
&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> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.