pub trait Rotation<P>:
Sized
+ Copy
+ One
+ AbsDiffEq<Epsilon = <P as EuclideanSpace>::Scalar, Epsilon = <P as EuclideanSpace>::Scalar, Epsilon = <P as EuclideanSpace>::Scalar>
+ RelativeEq
+ UlpsEq
+ Product{
// Required methods
fn look_at(
dir: <P as EuclideanSpace>::Diff,
up: <P as EuclideanSpace>::Diff,
) -> Self;
fn between_vectors(
a: <P as EuclideanSpace>::Diff,
b: <P as EuclideanSpace>::Diff,
) -> Self;
fn rotate_vector(
&self,
vec: <P as EuclideanSpace>::Diff,
) -> <P as EuclideanSpace>::Diff;
fn invert(&self) -> Self;
// Provided method
fn rotate_point(&self, point: P) -> P { ... }
}
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 as EuclideanSpace>::Diff,
up: <P as EuclideanSpace>::Diff,
) -> Self
fn look_at( dir: <P as EuclideanSpace>::Diff, up: <P as EuclideanSpace>::Diff, ) -> Self
Create a rotation to a given direction with an ‘up’ vector.
Sourcefn between_vectors(
a: <P as EuclideanSpace>::Diff,
b: <P as EuclideanSpace>::Diff,
) -> Self
fn between_vectors( 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.
Sourcefn rotate_vector(
&self,
vec: <P as EuclideanSpace>::Diff,
) -> <P as EuclideanSpace>::Diff
fn rotate_vector( &self, vec: <P as EuclideanSpace>::Diff, ) -> <P as EuclideanSpace>::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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.