use crate::math::{Isometry, Real};
use crate::query::ClosestPoints;
use crate::shape::{Ball, Shape};
#[inline]
pub fn closest_points_ball_convex_polyhedron(
pos12: &Isometry<Real>,
ball1: &Ball,
shape2: &(impl Shape + ?Sized),
prediction: Real,
) -> ClosestPoints {
match crate::query::details::contact_ball_convex_polyhedron(pos12, ball1, shape2, prediction) {
Some(contact) => {
if contact.dist <= 0.0 {
ClosestPoints::Intersecting
} else {
ClosestPoints::WithinMargin(contact.point1, contact.point2)
}
}
None => ClosestPoints::Disjoint,
}
}
#[inline]
pub fn closest_points_convex_polyhedron_ball(
pos12: &Isometry<Real>,
shape1: &(impl Shape + ?Sized),
ball2: &Ball,
prediction: Real,
) -> ClosestPoints {
match crate::query::details::contact_convex_polyhedron_ball(pos12, shape1, ball2, prediction) {
Some(contact) => {
if contact.dist <= 0.0 {
ClosestPoints::Intersecting
} else {
ClosestPoints::WithinMargin(contact.point1, contact.point2)
}
}
None => ClosestPoints::Disjoint,
}
}