Trait ncollide2d::broad_phase::BroadPhase
source · pub trait BroadPhase<N: Real, BV, T>: Any + Sync + Send {
fn create_proxy(&mut self, bv: BV, data: T) -> ProxyHandle;
fn remove(
&mut self,
handles: &[ProxyHandle],
removal_handler: &mut dyn FnMut(&T, &T)
);
fn deferred_set_bounding_volume(&mut self, handle: ProxyHandle, bv: BV);
fn deferred_recompute_all_proximities_with(&mut self, handle: ProxyHandle);
fn deferred_recompute_all_proximities(&mut self);
fn update(
&mut self,
allow_proximity: &mut dyn FnMut(&T, &T) -> bool,
proximity_handler: &mut dyn FnMut(&T, &T, bool)
);
fn interferences_with_bounding_volume<'a>(
&'a self,
bv: &BV,
out: &mut Vec<&'a T>
);
fn interferences_with_ray<'a>(&'a self, ray: &Ray<N>, out: &mut Vec<&'a T>);
fn interferences_with_point<'a>(
&'a self,
point: &Point<N>,
out: &mut Vec<&'a T>
);
}
Expand description
Trait all broad phase must implement.
Required Methods§
sourcefn 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.
sourcefn remove(
&mut self,
handles: &[ProxyHandle],
removal_handler: &mut dyn FnMut(&T, &T)
)
fn remove(
&mut self,
handles: &[ProxyHandle],
removal_handler: &mut dyn FnMut(&T, &T)
)
Tells the broad phase to remove the given set of handles.
sourcefn deferred_set_bounding_volume(&mut self, handle: ProxyHandle, bv: BV)
fn deferred_set_bounding_volume(&mut self, handle: ProxyHandle, bv: BV)
Sets the next bounding volume to be used during the update of this broad phase.
sourcefn 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.
sourcefn 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.
sourcefn update(
&mut self,
allow_proximity: &mut dyn FnMut(&T, &T) -> bool,
proximity_handler: &mut dyn FnMut(&T, &T, bool)
)
fn update(
&mut self,
allow_proximity: &mut dyn FnMut(&T, &T) -> bool,
proximity_handler: &mut dyn FnMut(&T, &T, bool)
)
Updates the object additions, removals, and interferences detection.
sourcefn 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.
sourcefn interferences_with_ray<'a>(&'a self, ray: &Ray<N>, out: &mut Vec<&'a T>)
fn interferences_with_ray<'a>(&'a self, ray: &Ray<N>, out: &mut Vec<&'a T>)
Collects every object which might intersect a given ray.
sourcefn interferences_with_point<'a>(&'a self, point: &Point<N>, out: &mut Vec<&'a T>)
fn interferences_with_point<'a>(&'a self, point: &Point<N>, out: &mut Vec<&'a T>)
Collects every object which might contain a given point.