Struct oxygengine_physics_2d::prelude::ncollide2d::partitioning::DBVT
source · pub struct DBVT<N, T, BV>where
N: RealField + Copy,{ /* private fields */ }
Expand description
A bounding volume hierarchy on which objects can be added or removed after construction.
Implementations§
source§impl<N, T, BV> DBVT<N, T, BV>where
N: RealField + Copy,
BV: BoundingVolume<N>,
impl<N, T, BV> DBVT<N, T, BV>where N: RealField + Copy, BV: BoundingVolume<N>,
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) -> Option<&DBVTLeaf<N, T, BV>>
pub fn get(&self, _: DBVTLeafId) -> Option<&DBVTLeaf<N, T, BV>>
Gets the given leaf if it exists.
Trait Implementations§
source§impl<'a, N, T, BV> BVH<T, BV> for DBVT<N, T, BV>where
N: RealField + Copy,
impl<'a, N, T, BV> BVH<T, BV> for DBVT<N, T, BV>where N: RealField + Copy,
§type Node = DBVTNodeId
type Node = DBVTNodeId
Type of a node identifiers on this BVH.
source§fn num_children(&self, node: <DBVT<N, T, BV> as BVH<T, BV>>::Node) -> usize
fn num_children(&self, node: <DBVT<N, T, BV> as BVH<T, BV>>::Node) -> usize
The number of children of the given node.
source§fn child(
&self,
i: usize,
node: <DBVT<N, T, BV> as BVH<T, BV>>::Node
) -> <DBVT<N, T, BV> as BVH<T, BV>>::Node
fn child( &self, i: usize, node: <DBVT<N, T, BV> as BVH<T, BV>>::Node ) -> <DBVT<N, T, BV> as BVH<T, BV>>::Node
The i-th child of the given node.
source§fn content(
&self,
node: <DBVT<N, T, BV> as BVH<T, BV>>::Node
) -> (&BV, Option<&T>)
fn content( &self, node: <DBVT<N, T, BV> as BVH<T, BV>>::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
.source§fn best_first_search<N, BFS>(
&self,
visitor: &mut BFS
) -> Option<(Self::Node, <BFS as BestFirstVisitor<N, T, BV>>::Result)>where
N: RealField + Copy,
BFS: BestFirstVisitor<N, T, BV>,
fn best_first_search<N, BFS>( &self, visitor: &mut BFS ) -> Option<(Self::Node, <BFS as BestFirstVisitor<N, T, BV>>::Result)>where N: RealField + Copy, BFS: BestFirstVisitor<N, T, BV>,
Performs a best-first-search on the BVH. Read more
Auto Trait Implementations§
impl<N, T, BV> RefUnwindSafe for DBVT<N, T, BV>where BV: RefUnwindSafe, N: RefUnwindSafe, T: RefUnwindSafe,
impl<N, T, BV> Send for DBVT<N, T, BV>where BV: Send, T: Send,
impl<N, T, BV> Sync for DBVT<N, T, BV>where BV: Sync, T: Sync,
impl<N, T, BV> Unpin for DBVT<N, T, BV>where BV: Unpin, N: Unpin, T: Unpin,
impl<N, T, BV> UnwindSafe for DBVT<N, T, BV>where BV: UnwindSafe, N: UnwindSafe, 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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§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.§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.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.