pub trait BroadPhase<N: RealField + Copy, BV, T>:
Any
+ Sync
+ Send {
// Required methods
fn create_proxy(&mut self, bv: BV, data: T) -> BroadPhaseProxyHandle;
fn proxy(&self, handle: BroadPhaseProxyHandle) -> Option<(&BV, &T)>;
fn remove(
&mut self,
handles: &[BroadPhaseProxyHandle],
removal_handler: &mut dyn FnMut(&T, &T),
);
fn deferred_set_bounding_volume(
&mut self,
handle: BroadPhaseProxyHandle,
bv: BV,
);
fn deferred_recompute_all_proximities_with(
&mut self,
handle: BroadPhaseProxyHandle,
);
fn deferred_recompute_all_proximities(&mut self);
fn update(&mut self, handler: &mut dyn BroadPhaseInterferenceHandler<T>);
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>,
max_toi: N,
out: &mut Vec<&'a T>,
);
fn interferences_with_point<'a>(
&'a self,
point: &Point<N>,
out: &mut Vec<&'a T>,
);
fn first_interference_with_ray<'a, 'b>(
&'a self,
ray: &'b Ray<N>,
max_toi: N,
cost_fn: &'a dyn Fn(T, &'b Ray<N>, N) -> Option<(T, RayIntersection<N>)>,
) -> Option<(T, RayIntersection<N>)>;
}
Expand description
Trait all broad phase must implement.
Required Methods§
Sourcefn create_proxy(&mut self, bv: BV, data: T) -> BroadPhaseProxyHandle
fn create_proxy(&mut self, bv: BV, data: T) -> BroadPhaseProxyHandle
Tells the broad phase to add a bounding-volume at the next update.
Sourcefn proxy(&self, handle: BroadPhaseProxyHandle) -> Option<(&BV, &T)>
fn proxy(&self, handle: BroadPhaseProxyHandle) -> Option<(&BV, &T)>
Retrieves the bounding volume and data associated to the given proxy.
Sourcefn remove(
&mut self,
handles: &[BroadPhaseProxyHandle],
removal_handler: &mut dyn FnMut(&T, &T),
)
fn remove( &mut self, handles: &[BroadPhaseProxyHandle], 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: BroadPhaseProxyHandle,
bv: BV,
)
fn deferred_set_bounding_volume( &mut self, handle: BroadPhaseProxyHandle, 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: BroadPhaseProxyHandle,
)
fn deferred_recompute_all_proximities_with( &mut self, handle: BroadPhaseProxyHandle, )
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, handler: &mut dyn BroadPhaseInterferenceHandler<T>)
fn update(&mut self, handler: &mut dyn BroadPhaseInterferenceHandler<T>)
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>,
max_toi: N,
out: &mut Vec<&'a T>,
)
fn interferences_with_ray<'a>( &'a self, ray: &Ray<N>, max_toi: 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.