pub trait Rotation<P: EuclideanSpace>: PartialEq + Sizedwhere
Self: ApproxEq<Epsilon = <P as EuclideanSpace>::Scalar>,
<P as EuclideanSpace>::Scalar: BaseFloat,{
// Required methods
fn one() -> Self;
fn look_at(dir: P::Diff, up: P::Diff) -> Self;
fn between_vectors(a: P::Diff, b: P::Diff) -> Self;
fn rotate_vector(&self, vec: P::Diff) -> P::Diff;
fn concat(&self, other: &Self) -> Self;
fn invert(&self) -> Self;
// Provided methods
fn rotate_point(&self, point: P) -> P { ... }
fn concat_self(&mut self, other: &Self) { ... }
fn invert_self(&mut self) { ... }
}
Expand description
A trait for a generic rotation. A rotation is a transformation that creates a circular motion, and preserves at least one point in the space.
Required Methods§
sourcefn look_at(dir: P::Diff, up: P::Diff) -> Self
fn look_at(dir: P::Diff, up: P::Diff) -> Self
Create a rotation to a given direction with an ‘up’ vector
sourcefn between_vectors(a: P::Diff, b: P::Diff) -> Self
fn between_vectors(a: P::Diff, b: P::Diff) -> Self
Create a shortest rotation to transform vector ‘a’ into ‘b’. Both given vectors are assumed to have unit length.
sourcefn rotate_vector(&self, vec: P::Diff) -> P::Diff
fn rotate_vector(&self, vec: P::Diff) -> P::Diff
Rotate a vector using this rotation.
Provided Methods§
sourcefn rotate_point(&self, point: P) -> P
fn rotate_point(&self, point: P) -> P
Rotate a point using this rotation, by converting it to its representation as a vector.
sourcefn concat_self(&mut self, other: &Self)
fn concat_self(&mut self, other: &Self)
Modify this rotation in-place by combining it with another.
sourcefn invert_self(&mut self)
fn invert_self(&mut self)
Invert this rotation in-place.