parry3d/query/closest_points/
closest_points_ball_convex_polyhedron.rs1use crate::math::{Isometry, Real};
2use crate::query::ClosestPoints;
3use crate::shape::{Ball, Shape};
4
5#[inline]
10pub fn closest_points_ball_convex_polyhedron(
11 pos12: &Isometry<Real>,
12 ball1: &Ball,
13 shape2: &(impl Shape + ?Sized),
14 prediction: Real,
15) -> ClosestPoints {
16 match crate::query::details::contact_ball_convex_polyhedron(pos12, ball1, shape2, prediction) {
17 Some(contact) => {
18 if contact.dist <= 0.0 {
19 ClosestPoints::Intersecting
20 } else {
21 ClosestPoints::WithinMargin(contact.point1, contact.point2)
22 }
23 }
24 None => ClosestPoints::Disjoint,
25 }
26}
27
28#[inline]
33pub fn closest_points_convex_polyhedron_ball(
34 pos12: &Isometry<Real>,
35 shape1: &(impl Shape + ?Sized),
36 ball2: &Ball,
37 prediction: Real,
38) -> ClosestPoints {
39 match crate::query::details::contact_convex_polyhedron_ball(pos12, shape1, ball2, prediction) {
40 Some(contact) => {
41 if contact.dist <= 0.0 {
42 ClosestPoints::Intersecting
43 } else {
44 ClosestPoints::WithinMargin(contact.point1, contact.point2)
45 }
46 }
47 None => ClosestPoints::Disjoint,
48 }
49}