Trait nannou::math::Rotation [−][src]
pub trait Rotation<P>: Copy + One + AbsDiffEq<Self, Epsilon = <P as EuclideanSpace>::Scalar, Epsilon = <P as EuclideanSpace>::Scalar, Epsilon = <P as EuclideanSpace>::Scalar> + RelativeEq<Self> + UlpsEq<Self> + Product<Self> where
P: EuclideanSpace,
<P as EuclideanSpace>::Scalar: BaseFloat, { pub fn look_at(
dir: <P as EuclideanSpace>::Diff,
up: <P as EuclideanSpace>::Diff
) -> Self; pub fn between_vectors(
a: <P as EuclideanSpace>::Diff,
b: <P as EuclideanSpace>::Diff
) -> Self; pub fn rotate_vector(
&self,
vec: <P as EuclideanSpace>::Diff
) -> <P as EuclideanSpace>::Diff; pub fn invert(&self) -> Self; pub fn rotate_point(&self, point: P) -> P { ... } }
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
pub fn look_at(
dir: <P as EuclideanSpace>::Diff,
up: <P as EuclideanSpace>::Diff
) -> Self
[src]
dir: <P as EuclideanSpace>::Diff,
up: <P as EuclideanSpace>::Diff
) -> Self
Create a rotation to a given direction with an ‘up’ vector.
pub fn between_vectors(
a: <P as EuclideanSpace>::Diff,
b: <P as EuclideanSpace>::Diff
) -> Self
[src]
a: <P as EuclideanSpace>::Diff,
b: <P as EuclideanSpace>::Diff
) -> Self
Create a shortest rotation to transform vector ‘a’ into ‘b’. Both given vectors are assumed to have unit length.
pub fn rotate_vector(
&self,
vec: <P as EuclideanSpace>::Diff
) -> <P as EuclideanSpace>::Diff
[src]
&self,
vec: <P as EuclideanSpace>::Diff
) -> <P as EuclideanSpace>::Diff
Rotate a vector using this rotation.
pub fn invert(&self) -> Self
[src]
Create a new rotation which “un-does” this rotation. That is,
r * r.invert()
is the identity.
Provided methods
pub fn rotate_point(&self, point: P) -> P
[src]
Rotate a point using this rotation, by converting it to its representation as a vector.
Implementors
impl<S> Rotation<Point2<S>> for Basis2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
pub fn look_at(dir: Vector2<S>, up: Vector2<S>) -> Basis2<S>
[src]
pub fn between_vectors(a: Vector2<S>, b: Vector2<S>) -> Basis2<S>
[src]
pub fn rotate_vector(&self, vec: Vector2<S>) -> Vector2<S>
[src]
pub fn invert(&self) -> Basis2<S>
[src]
impl<S> Rotation<Point3<S>> for Basis3<S> where
S: BaseFloat,
[src]
S: BaseFloat,
pub fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Basis3<S>
[src]
pub fn between_vectors(a: Vector3<S>, b: Vector3<S>) -> Basis3<S>
[src]
pub fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>
[src]
pub fn invert(&self) -> Basis3<S>
[src]
impl<S> Rotation<Point3<S>> for Quaternion<S> where
S: BaseFloat,
[src]
S: BaseFloat,