ncollide3d/pipeline/narrow_phase/proximity_detector/
proximity_detector.rs1use crate::math::Isometry;
2use crate::query::Proximity;
3use crate::shape::Shape;
4use na::RealField;
5use std::any::Any;
6
7pub trait ProximityDetector<N: RealField + Copy>: Any + Send + Sync {
9 fn update(
12 &mut self,
13 dispatcher: &dyn ProximityDispatcher<N>,
14 ma: &Isometry<N>,
15 a: &dyn Shape<N>,
16 mb: &Isometry<N>,
17 b: &dyn Shape<N>,
18 margin: N,
19 ) -> Option<Proximity>;
20}
21
22pub type ProximityAlgorithm<N> = Box<dyn ProximityDetector<N>>;
23
24pub trait ProximityDispatcher<N>: Any + Send + Sync {
25 fn get_proximity_algorithm(
27 &self,
28 a: &dyn Shape<N>,
29 b: &dyn Shape<N>,
30 ) -> Option<ProximityAlgorithm<N>>;
31}