Trait truck_rendimpl::modeling::Rotation[]

pub trait Rotation: Copy + One + AbsDiffEq<Self, Epsilon = <Self::Space as EuclideanSpace>::Scalar, Epsilon = <Self::Space as EuclideanSpace>::Scalar, Epsilon = <Self::Space as EuclideanSpace>::Scalar> + RelativeEq<Self> + UlpsEq<Self> + Product<Self> where
    <Self::Space as EuclideanSpace>::Scalar: BaseFloat, 
{ type Space: EuclideanSpace; pub fn look_at(
        dir: <Self::Space as EuclideanSpace>::Diff,
        up: <Self::Space as EuclideanSpace>::Diff
    ) -> Self;
pub fn between_vectors(
        a: <Self::Space as EuclideanSpace>::Diff,
        b: <Self::Space as EuclideanSpace>::Diff
    ) -> Self;
pub fn rotate_vector(
        &self,
        vec: <Self::Space as EuclideanSpace>::Diff
    ) -> <Self::Space as EuclideanSpace>::Diff;
pub fn invert(&self) -> Self; pub fn rotate_point(&self, point: Self::Space) -> Self::Space { ... } }

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

Loading content...

Required methods

pub 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.

pub 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.

pub fn rotate_vector(
    &self,
    vec: <Self::Space as EuclideanSpace>::Diff
) -> <Self::Space as EuclideanSpace>::Diff

Rotate a vector using this rotation.

pub fn invert(&self) -> Self

Create a new rotation which “un-does” this rotation. That is, r * r.invert() is the identity.

Loading content...

Provided methods

pub fn rotate_point(&self, point: Self::Space) -> Self::Space

Rotate a point using this rotation, by converting it to its representation as a vector.

Loading content...

Implementations on Foreign Types

impl<S> Rotation for Basis3<S> where
    S: BaseFloat, 

type Space = Point3<S>

impl<S> Rotation for Quaternion<S> where
    S: BaseFloat, 

type Space = Point3<S>

pub fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>

Evaluate the conjugation of vec by self.

Note that self should be a unit quaternion (i.e. normalized) to represent a 3D rotation.

impl<S> Rotation for Basis2<S> where
    S: BaseFloat, 

type Space = Point2<S>

Loading content...

Implementors

Loading content...