[src]

Struct ncollide2df64::narrow::algorithm::johnson_simplex::JohnsonSimplex

pub struct JohnsonSimplex<_V> {
    // some fields omitted
}

Simplex using the Johnson subalgorithm to compute the projection of the origin on the simplex.

Methods

impl<_V: Dim> JohnsonSimplex<_V>

fn new(recursion: Arc<~[RecursionTemplate]>) -> JohnsonSimplex<_V>

Creates a new, empty, Johnson simplex.

fn new_w_tls() -> JohnsonSimplex<_V>

Creates a new, empty Johnson simplex. The recursion template uses the thread-local one.

Trait Implementations

impl<_V: Clone> Clone for JohnsonSimplex<_V>

Automatically derived.

fn clone(&self) -> JohnsonSimplex<_V>

impl<_V: Clone + RealVec<N>> Simplex<_V> for JohnsonSimplex<_V>

fn reset(&mut self, pt: _V)

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

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.

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

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

fn add_point(&mut self, pt: _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 translate_by(&mut self, v: &_V)

Translates each point of this simplex.