use na; use na::{Translate, Translation}; use math::{Point, Vector, Isometry}; use entities::inspection; use entities::inspection::Repr; use entities::shape::{Ball, Plane}; use entities::bounding_volume::{HasBoundingVolume, AABB}; use geometry::contacts_internal; use geometry::contacts_internal::Contact; /// Computes one contact point between two shapes. /// /// Returns `None` if the objects are separated by a distance greater than `prediction`. pub fn any_against_any
(m1: &M, g1: &G1,
m2: &M, g2: &G2,
prediction: ,
M: Isometry + Translation + HasBoundingVolume + HasBoundingVolume (r2)) {
contacts_internal::plane_against_support_map(m1, p1, m2, s2, prediction)
}
else if let (Some(s1), Some(p2)) =
(inspection::maybe_repr_desc_as_support_map:: (r1), r2.downcast_ref:: (r1),
inspection::maybe_repr_desc_as_support_map:: (r2)) {
contacts_internal::support_map_against_support_map(m1, s1, m2, s2, prediction)
}
else if let Some(c1) = inspection::maybe_repr_desc_as_composite_shape:: (r1) {
contacts_internal::composite_shape_against_any(m1, c1, m2, g2, prediction)
}
else if let Some(c2) = inspection::maybe_repr_desc_as_composite_shape:: (r2) {
contacts_internal::any_against_composite_shape(m1, g1, m2, c2, prediction)
}
else {
panic!("No algorithm known to compute a contact point between the given pair of shapes.")
}
}