Trait cgmath::Rotation [−][src]
pub trait Rotation: Sized + Copy + One where
Self: AbsDiffEq<Epsilon = <Self::Space as EuclideanSpace>::Scalar>,
Self: RelativeEq<Epsilon = <Self::Space as EuclideanSpace>::Scalar>,
Self: UlpsEq<Epsilon = <Self::Space as EuclideanSpace>::Scalar>,
<Self::Space as EuclideanSpace>::Scalar: BaseFloat,
Self: Product<Self>, {
type Space: EuclideanSpace;
fn look_at(
dir: <Self::Space as EuclideanSpace>::Diff,
up: <Self::Space as EuclideanSpace>::Diff
) -> Self;
fn between_vectors(
a: <Self::Space as EuclideanSpace>::Diff,
b: <Self::Space as EuclideanSpace>::Diff
) -> Self;
fn rotate_vector(
&self,
vec: <Self::Space as EuclideanSpace>::Diff
) -> <Self::Space as EuclideanSpace>::Diff;
fn invert(&self) -> Self;
fn rotate_point(&self, point: Self::Space) -> Self::Space { ... }
}
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.
Associated Types
type Space: EuclideanSpace
Required methods
fn look_at(
dir: <Self::Space as EuclideanSpace>::Diff,
up: <Self::Space as EuclideanSpace>::Diff
) -> Self
fn look_at(
dir: <Self::Space as EuclideanSpace>::Diff,
up: <Self::Space as EuclideanSpace>::Diff
) -> Self
Create a rotation to a given direction with an ‘up’ vector.
fn between_vectors(
a: <Self::Space as EuclideanSpace>::Diff,
b: <Self::Space as EuclideanSpace>::Diff
) -> Self
fn between_vectors(
a: <Self::Space as EuclideanSpace>::Diff,
b: <Self::Space as EuclideanSpace>::Diff
) -> Self
Create a shortest rotation to transform vector ‘a’ into ‘b’. Both given vectors are assumed to have unit length.
fn rotate_vector(
&self,
vec: <Self::Space as EuclideanSpace>::Diff
) -> <Self::Space as EuclideanSpace>::Diff
fn rotate_vector(
&self,
vec: <Self::Space as EuclideanSpace>::Diff
) -> <Self::Space as EuclideanSpace>::Diff
Rotate a vector using this rotation.
Provided methods
fn rotate_point(&self, point: Self::Space) -> Self::Space
fn rotate_point(&self, point: Self::Space) -> Self::Space
Rotate a point using this rotation, by converting it to its representation as a vector.