Struct ncollide2d::broad_phase::DBVTBroadPhase
source · pub struct DBVTBroadPhase<N: Real, BV, T> { /* private fields */ }
Expand description
Broad phase based on a Dynamic Bounding Volume Tree.
It uses two separate trees: one for static objects and which is never updated, and one for moving objects.
Implementations§
source§impl<N, BV, T> DBVTBroadPhase<N, BV, T>where
N: Real,
BV: 'static + BoundingVolume<N> + Clone,
impl<N, BV, T> DBVTBroadPhase<N, BV, T>where
N: Real,
BV: 'static + BoundingVolume<N> + Clone,
sourcepub fn new(margin: N) -> DBVTBroadPhase<N, BV, T>
pub fn new(margin: N) -> DBVTBroadPhase<N, BV, T>
Creates a new broad phase based on a Dynamic Bounding Volume Tree.
sourcepub fn num_interferences(&self) -> usize
pub fn num_interferences(&self) -> usize
Number of interferences detected by this broad phase.
Trait Implementations§
source§impl<N, BV, T> BroadPhase<N, BV, T> for DBVTBroadPhase<N, BV, T>where
N: Real,
BV: BoundingVolume<N> + RayCast<N> + PointQuery<N> + Any + Send + Sync + Clone,
T: Any + Send + Sync,
impl<N, BV, T> BroadPhase<N, BV, T> for DBVTBroadPhase<N, BV, T>where
N: Real,
BV: BoundingVolume<N> + RayCast<N> + PointQuery<N> + Any + Send + Sync + Clone,
T: Any + Send + Sync,
source§fn update(
&mut self,
allow_proximity: &mut dyn FnMut(&T, &T) -> bool,
handler: &mut dyn FnMut(&T, &T, bool)
)
fn update(
&mut self,
allow_proximity: &mut dyn FnMut(&T, &T) -> bool,
handler: &mut dyn FnMut(&T, &T, bool)
)
Updates the object additions, removals, and interferences detection.
source§fn create_proxy(&mut self, bv: BV, data: T) -> ProxyHandle
fn create_proxy(&mut self, bv: BV, data: T) -> ProxyHandle
Tells the broad phase to add a bounding-volume at the next update.
source§fn remove(&mut self, handles: &[ProxyHandle], handler: &mut dyn FnMut(&T, &T))
fn remove(&mut self, handles: &[ProxyHandle], handler: &mut dyn FnMut(&T, &T))
Tells the broad phase to remove the given set of handles.
source§fn deferred_set_bounding_volume(
&mut self,
handle: ProxyHandle,
bounding_volume: BV
)
fn deferred_set_bounding_volume(
&mut self,
handle: ProxyHandle,
bounding_volume: BV
)
Sets the next bounding volume to be used during the update of this broad phase.
source§fn deferred_recompute_all_proximities_with(&mut self, handle: ProxyHandle)
fn deferred_recompute_all_proximities_with(&mut self, handle: ProxyHandle)
Forces the broad-phase to recompute and re-report all the proximities with the given object.
source§fn deferred_recompute_all_proximities(&mut self)
fn deferred_recompute_all_proximities(&mut self)
Forces the broad-phase to recompute and re-report all the proximities.
source§fn interferences_with_bounding_volume<'a>(&'a self, bv: &BV, out: &mut Vec<&'a T>)
fn interferences_with_bounding_volume<'a>(&'a self, bv: &BV, out: &mut Vec<&'a T>)
Collects every object which might intersect a given bounding volume.
Auto Trait Implementations§
impl<N, BV, T> RefUnwindSafe for DBVTBroadPhase<N, BV, T>where
BV: RefUnwindSafe,
N: RefUnwindSafe,
T: RefUnwindSafe,
impl<N, BV, T> Send for DBVTBroadPhase<N, BV, T>where
BV: Send,
T: Send,
impl<N, BV, T> Sync for DBVTBroadPhase<N, BV, T>where
BV: Sync,
T: Sync,
impl<N, BV, T> Unpin for DBVTBroadPhase<N, BV, T>where
BV: Unpin,
N: Unpin,
T: Unpin,
impl<N, BV, T> UnwindSafe for DBVTBroadPhase<N, BV, T>where
BV: UnwindSafe,
N: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.