[][src]Trait collision::algorithm::minkowski::SimplexProcessor

pub trait SimplexProcessor {
    type Point: EuclideanSpace;
    fn reduce_to_closest_feature(
        &self,
        simplex: &mut SmallVec<[SupportPoint<Self::Point>; 5]>,
        d: &mut <Self::Point as EuclideanSpace>::Diff
    ) -> bool;
fn get_closest_point_to_origin(
        &self,
        simplex: &mut SmallVec<[SupportPoint<Self::Point>; 5]>
    ) -> <Self::Point as EuclideanSpace>::Diff;
fn new() -> Self; }

Defined a simplex processor for use in GJK.

Associated Types

type Point: EuclideanSpace

The point type of the processor

Loading content...

Required methods

fn reduce_to_closest_feature(
    &self,
    simplex: &mut SmallVec<[SupportPoint<Self::Point>; 5]>,
    d: &mut <Self::Point as EuclideanSpace>::Diff
) -> bool

Check if the given simplex contains origin, and if not, update the simplex and search direction.

Used by the GJK intersection test

fn get_closest_point_to_origin(
    &self,
    simplex: &mut SmallVec<[SupportPoint<Self::Point>; 5]>
) -> <Self::Point as EuclideanSpace>::Diff

Get the closest point on the simplex to the origin.

Will also update the simplex to contain only the feature that is closest to the origin. This will be an edge for 2D; and it will be an edge or a face for 3D. This is primarily used by the GJK distance computation.

fn new() -> Self

Create a new simplex processor

Loading content...

Implementors

Loading content...