Function oxygengine_physics_2d::prelude::ncollide2d::query::algorithms::gjk::closest_points
source · pub fn closest_points<N, G1, G2>(
m1: &Isometry<N, Unit<Complex<N>>, 2>,
g1: &G1,
m2: &Isometry<N, Unit<Complex<N>>, 2>,
g2: &G2,
max_dist: N,
exact_dist: bool,
simplex: &mut VoronoiSimplex<N>
) -> GJKResult<N>where
N: RealField + Copy,
G1: SupportMap<N> + ?Sized,
G2: SupportMap<N> + ?Sized,
Expand description
Projects the origin on a shape using the Separating Axis GJK algorithm.
The algorithm will stop as soon as the polytope can be proven to be at least max_dist
away
from the origin.
Arguments:
- simplex - the simplex to be used by the GJK algorithm. It must be already initialized with at least one point on the shape boundary.
- exact_dist - if
false
, the gjk will stop as soon as it can prove that the origin is at a distance smaller thanmax_dist
but not inside ofshape
. In that case, it returns aGJKResult::Proximity(sep_axis)
wheresep_axis
is a separating axis. Iffalse
the gjk will compute the exact distance and returnGJKResult::Projection(point)
if the origin is closer thanmax_dist
but not insideshape
.