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§
Sourcetype Point: EuclideanSpace
type Point: EuclideanSpace
The point type of the processor
Required Methods§
Sourcefn reduce_to_closest_feature(
&self,
simplex: &mut SmallVec<[SupportPoint<Self::Point>; 5]>,
d: &mut <Self::Point as EuclideanSpace>::Diff,
) -> bool
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
Sourcefn get_closest_point_to_origin(
&self,
simplex: &mut SmallVec<[SupportPoint<Self::Point>; 5]>,
) -> <Self::Point as EuclideanSpace>::Diff
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.
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.