use alga::linear::Translation; use math::{Isometry, Point}; use shape::{Ball, Plane, Shape}; use query::Proximity; use query::proximity_internal; /// Tests whether two shapes are in intersecting or separated by a distance smaller than `margin`. pub fn shape_against_shape
( m1: &M, g1: &Shape
, m2: &M, g2: &Shape
, margin: P::Real, ) -> Proximity where P: Point, M: Isometry
,
{
if let (Some(b1), Some(b2)) = (
g1.as_shape:: (m1, s1, m2, s2, margin)
} else if let Some(c1) = g1.as_composite_shape() {
proximity_internal::composite_shape_against_shape(m1, c1, m2, g2, margin)
} else if let Some(c2) = g2.as_composite_shape() {
proximity_internal::shape_against_composite_shape(m1, g1, m2, c2, margin)
} else {
panic!("No algorithm known to compute proximity between the given pair of shapes.")
}
}