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