Struct ultraviolet::transform::Similarity3x4
source · [−]#[repr(C)]pub struct Similarity3x4 {
pub translation: Vec3x4,
pub rotation: Rotor3x4,
pub scale: f32x4,
}
Expand description
A Similarity, i.e. an Isometry but with an added uniform scaling.
Defined as 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: Vec3x4
rotation: Rotor3x4
scale: f32x4
Implementations
sourceimpl Similarity3x4
impl Similarity3x4
pub const fn new(translation: Vec3x4, rotation: Rotor3x4, scale: f32x4) -> Self
pub fn identity() -> Self
sourcepub fn prepend_scaling(&mut self, scaling: f32x4)
pub fn prepend_scaling(&mut self, scaling: f32x4)
Add a scaling before this similarity.
This means the scaling will only affect the scaling part of this similarity, not the translational part.
sourcepub fn append_scaling(&mut self, scaling: f32x4)
pub fn append_scaling(&mut self, scaling: f32x4)
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.
sourcepub fn prepend_rotation(&mut self, rotor: Rotor3x4)
pub fn prepend_rotation(&mut self, rotor: Rotor3x4)
Add a rotation before this similarity.
This means the rotation will only affect the rotational part of this similarity, not the translational part.
sourcepub fn append_rotation(&mut self, rotor: Rotor3x4)
pub fn append_rotation(&mut self, rotor: Rotor3x4)
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.
sourcepub fn prepend_translation(&mut self, translation: Vec3x4)
pub fn prepend_translation(&mut self, translation: Vec3x4)
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.
sourcepub fn append_translation(&mut self, translation: Vec3x4)
pub fn append_translation(&mut self, translation: Vec3x4)
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.
sourcepub fn prepend_similarity(&mut self, other: Self)
pub fn prepend_similarity(&mut self, other: Self)
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.
sourcepub fn append_similarity(&mut self, other: Self)
pub fn append_similarity(&mut self, other: Self)
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)
pub fn inversed(self) -> Self
pub fn transform_vec(&self, vec: Vec3x4) -> Vec3x4
pub fn into_homogeneous_matrix(self) -> Mat4x4
Trait Implementations
sourceimpl Add<Similarity3x4> for Similarity3x4
impl Add<Similarity3x4> for Similarity3x4
type Output = Self
type Output = Self
The resulting type after applying the +
operator.
sourcefn add(self, other: Similarity3x4) -> Similarity3x4
fn add(self, other: Similarity3x4) -> Similarity3x4
Performs the +
operation. Read more
sourceimpl Clone for Similarity3x4
impl Clone for Similarity3x4
sourcefn clone(&self) -> Similarity3x4
fn clone(&self) -> Similarity3x4
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Similarity3x4
impl Debug for Similarity3x4
sourceimpl Default for Similarity3x4
impl Default for Similarity3x4
sourceimpl Mul<Rotor3x4> for Similarity3x4
impl Mul<Rotor3x4> for Similarity3x4
type Output = Similarity3x4
type Output = Similarity3x4
The resulting type after applying the *
operator.
sourcefn mul(self, rotor: Rotor3x4) -> Similarity3x4
fn mul(self, rotor: Rotor3x4) -> Similarity3x4
Performs the *
operation. Read more
sourceimpl Mul<Similarity3x4> for Rotor3x4
impl Mul<Similarity3x4> for Rotor3x4
type Output = Similarity3x4
type Output = Similarity3x4
The resulting type after applying the *
operator.
sourcefn mul(self, iso: Similarity3x4) -> Similarity3x4
fn mul(self, iso: Similarity3x4) -> Similarity3x4
Performs the *
operation. Read more
sourceimpl Mul<Similarity3x4> for Similarity3x4
impl Mul<Similarity3x4> for Similarity3x4
type Output = Self
type Output = Self
The resulting type after applying the *
operator.
sourcefn mul(self, base: Similarity3x4) -> Similarity3x4
fn mul(self, base: Similarity3x4) -> Similarity3x4
Performs the *
operation. Read more
sourceimpl Mul<Vec3x4> for Similarity3x4
impl Mul<Vec3x4> for Similarity3x4
sourceimpl Mul<f32x4> for Similarity3x4
impl Mul<f32x4> for Similarity3x4
sourceimpl PartialEq<Similarity3x4> for Similarity3x4
impl PartialEq<Similarity3x4> for Similarity3x4
sourcefn eq(&self, other: &Similarity3x4) -> bool
fn eq(&self, other: &Similarity3x4) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Similarity3x4) -> bool
fn ne(&self, other: &Similarity3x4) -> bool
This method tests for !=
.
impl Copy for Similarity3x4
impl StructuralPartialEq for Similarity3x4
Auto Trait Implementations
impl RefUnwindSafe for Similarity3x4
impl Send for Similarity3x4
impl Sync for Similarity3x4
impl Unpin for Similarity3x4
impl UnwindSafe for Similarity3x4
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more