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>,

source

pub fn new() -> DBVT<N, T, BV>

Creates a new empty dynamic bonding volume hierarchy.

source

pub fn root_bounding_volume(&self) -> Option<&BV>

The bounding volume of the root of this DBVT.

Returns None if the DBVT is empty.

source

pub fn is_empty(&self) -> bool

Indicates whether this DBVT empty.

source

pub fn insert(&mut self, leaf: DBVTLeaf<N, T, BV>) -> DBVTLeafId

Inserts a leaf into this DBVT.

source

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.

source

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,

§

type Node = DBVTNodeId

Type of a node identifiers on this BVH.
source§

fn root(&self) -> Option<<DBVT<N, T, BV> as BVH<T, BV>>::Node>

The root of the BVH.
source§

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

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>)

The bounding volume and data contained by the given node.
source§

fn visit(&self, visitor: &mut impl Visitor<T, BV>)

Traverses this BVH using a visitor.
source§

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.
Performs a best-first-search on the BVH. Read more
source§

impl<N, T, BV> Clone for DBVT<N, T, BV>where N: Clone + RealField + Copy, T: Clone, BV: Clone,

source§

fn clone(&self) -> DBVT<N, T, BV>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<N, T, BV> Index<DBVTLeafId> for DBVT<N, T, BV>where N: RealField + Copy,

§

type Output = DBVTLeaf<N, T, BV>

The returned type after indexing.
source§

fn index(&self, _: DBVTLeafId) -> &<DBVT<N, T, BV> as Index<DBVTLeafId>>::Output

Performs the indexing (container[index]) operation. 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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere T: Any,

§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Send + Sync, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> Finalize for T

§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

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

Checks if self is actually part of its subset T (and can be converted to it).
§

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

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UserData for Twhere T: Clone + Any + Send + Sync,

source§

fn clone_boxed(&self) -> Box<dyn UserData, Global>

Clone this trait-object.
source§

fn to_any(&self) -> Box<dyn Any + Send + Sync, Global>

Clone as its super-trait trait objects.
source§

fn as_any(&self) -> &(dyn Any + Send + Sync + 'static)

Downcast to Any.
§

impl<T> Component for Twhere T: Send + Sync + 'static,