[][src]Struct ultraviolet::transform::WSimilarity2

#[repr(C)]
pub struct WSimilarity2 {
    pub translation: Wec2,
    pub rotation: WRotor2,
    pub scale: f32x4,
}

A Similarity, also known as a "rigid body transformation", i.e. a uniform scaling followed by a rotation followed by a translation.

You may want to us this type over the corresponding type of homogeneous transformation matrix because it will be faster in most operations, especially composition and inverse.

Fields

translation: Wec2rotation: WRotor2scale: f32x4

Methods

impl WSimilarity2[src]

pub fn new(translation: Wec2, rotation: WRotor2, scale: f32x4) -> Self[src]

pub fn identity() -> Self[src]

pub fn prepend_scaling(&mut self, scaling: f32x4)[src]

Add a scaling before this similarity.

This means the scaling will only affect the scaling part of this similarity, not the translational part.

pub fn append_scaling(&mut self, scaling: f32x4)[src]

Add a scaling after this similarity.

This means the scaling will affect both the scaling and translational parts of this similairty, since it is being applied after this similarity's translational part.

pub fn prepend_rotation(&mut self, rotor: WRotor2)[src]

Add a rotation before this similarity.

This means the rotation will only affect the rotational part of this similarity, not the translational part.

pub fn append_rotation(&mut self, rotor: WRotor2)[src]

Add a rotation after this similarity.

This means the rotation will affect both the rotational and translational parts of this similarity, since it is being applied after this similarity's translational part.

pub fn prepend_translation(&mut self, translation: Wec2)[src]

Add a translation before this similarity.

Doing so will mean that the translation being added will get transformed by this similarity's rotational and scaling parts.

pub fn append_translation(&mut self, translation: Wec2)[src]

Add a translation after this similarity.

Doing so will mean that the translation being added will not transformed by this similarity's rotational or scaling parts.

pub fn prepend_similarity(&mut self, other: Self)[src]

Prepend transformation by another similarity.

This means that the transformation being applied will take place before this similarity, i.e. both its translation and rotation will be rotated by the other similarity's rotational part, and its translation will be scaled by the other similarity's scaling part.

pub fn append_similarity(&mut self, other: Self)[src]

Append transformation by another similarity.

This means that the transformation being applied will take place after this similarity, i.e. this similarity's translation and rotation will be rotated by the other similarity's rotational part, and this similarity's translation will be scaled by the other similarity's scaling pat.

pub fn inverse(&mut self)[src]

pub fn inversed(self) -> Self[src]

pub fn transform_vec(&self, vec: Wec2) -> Wec2[src]

pub fn into_homogeneous_matrix(self) -> Wat3[src]

Trait Implementations

impl Clone for WSimilarity2[src]

impl Copy for WSimilarity2[src]

impl Default for WSimilarity2[src]

impl Debug for WSimilarity2[src]

impl Mul<WSimilarity2> for WRotor2[src]

type Output = WSimilarity2

The resulting type after applying the * operator.

impl Mul<WRotor2> for WSimilarity2[src]

type Output = WSimilarity2

The resulting type after applying the * operator.

impl Mul<Wec2> for WSimilarity2[src]

type Output = Wec2

The resulting type after applying the * operator.

impl Mul<WSimilarity2> for WSimilarity2[src]

type Output = Self

The resulting type after applying the * operator.

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]