Trait SimplexProcessor

Source
pub trait SimplexProcessor {
    type Point: EuclideanSpace;

    // Required methods
    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;
}
Expand description

Defined a simplex processor for use in GJK.

Required Associated Types§

Source

type Point: EuclideanSpace

The point type of the processor

Required Methods§

Source

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

Source

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.

Source

fn new() -> Self

Create a new simplex processor

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§