[src]

Trait ncollide2df64::narrow::algorithm::simplex::Simplex

pub trait Simplex<_V> {
    fn reset(&mut self, _V);
    fn translate_by(&mut self, &_V);
    fn add_point(&mut self, _V);
    fn project_origin_and_reduce(&mut self) -> _V;
    fn project_origin(&mut self) -> _V;
    fn contains_point(&self, &_V) -> bool;
    fn dimension(&self) -> uint;
    fn max_sq_len(&self) -> N;
}

Trait of a simplex usable by the GJK algorithm.

Parameters:

Required Methods

fn reset(&mut self, _V)

Replace the point of the simplex by a single one. The simplex is reduced to be 0-dimensional.

fn translate_by(&mut self, &_V)

Translates each point of this simplex.

fn add_point(&mut self, _V)

Adds a point to the simplex.

fn project_origin_and_reduce(&mut self) -> _V

Project the origin on the simplex and remove any sub-simplex which does not contain the projection.

fn project_origin(&mut self) -> _V

Projection the origin on the simplex. The simplex itself in unchanged, although it is mutable for optimization purpose.

fn contains_point(&self, &_V) -> bool

Checks whether a given point is already part of the simplex points.

fn dimension(&self) -> uint

Dimension of the simplex. A simplex with n must be a n - 1-dimensional simplex.

fn max_sq_len(&self) -> N

The maximum among the simplex point squared lengths.

Implementors