Struct ultraviolet::transform::DSimilarity2x4
source · #[repr(C)]pub struct DSimilarity2x4 {
pub translation: DVec2x4,
pub rotation: DRotor2x4,
pub scale: f64x4,
}
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: DVec2x4
§rotation: DRotor2x4
§scale: f64x4
Implementations§
source§impl DSimilarity2x4
impl DSimilarity2x4
pub const fn new( translation: DVec2x4, rotation: DRotor2x4, scale: f64x4 ) -> Self
pub fn identity() -> Self
sourcepub fn prepend_scaling(&mut self, scaling: f64x4)
pub fn prepend_scaling(&mut self, scaling: f64x4)
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: f64x4)
pub fn append_scaling(&mut self, scaling: f64x4)
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: DRotor2x4)
pub fn prepend_rotation(&mut self, rotor: DRotor2x4)
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: DRotor2x4)
pub fn append_rotation(&mut self, rotor: DRotor2x4)
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: DVec2x4)
pub fn prepend_translation(&mut self, translation: DVec2x4)
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: DVec2x4)
pub fn append_translation(&mut self, translation: DVec2x4)
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: DVec2x4) -> DVec2x4
pub fn into_homogeneous_matrix(self) -> DMat3x4
Trait Implementations§
source§impl Add<DSimilarity2x4> for DSimilarity2x4
impl Add<DSimilarity2x4> for DSimilarity2x4
§type Output = DSimilarity2x4
type Output = DSimilarity2x4
+
operator.source§fn add(self, other: DSimilarity2x4) -> DSimilarity2x4
fn add(self, other: DSimilarity2x4) -> DSimilarity2x4
+
operation. Read moresource§impl Clone for DSimilarity2x4
impl Clone for DSimilarity2x4
source§fn clone(&self) -> DSimilarity2x4
fn clone(&self) -> DSimilarity2x4
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DSimilarity2x4
impl Debug for DSimilarity2x4
source§impl Default for DSimilarity2x4
impl Default for DSimilarity2x4
source§impl Mul<DRotor2x4> for DSimilarity2x4
impl Mul<DRotor2x4> for DSimilarity2x4
§type Output = DSimilarity2x4
type Output = DSimilarity2x4
*
operator.source§impl Mul<DSimilarity2x4> for DRotor2x4
impl Mul<DSimilarity2x4> for DRotor2x4
§type Output = DSimilarity2x4
type Output = DSimilarity2x4
*
operator.source§fn mul(self, iso: DSimilarity2x4) -> DSimilarity2x4
fn mul(self, iso: DSimilarity2x4) -> DSimilarity2x4
*
operation. Read moresource§impl Mul<DSimilarity2x4> for DSimilarity2x4
impl Mul<DSimilarity2x4> for DSimilarity2x4
§type Output = DSimilarity2x4
type Output = DSimilarity2x4
*
operator.source§fn mul(self, base: DSimilarity2x4) -> DSimilarity2x4
fn mul(self, base: DSimilarity2x4) -> DSimilarity2x4
*
operation. Read moresource§impl Mul<DVec2x4> for DSimilarity2x4
impl Mul<DVec2x4> for DSimilarity2x4
source§impl Mul<f64x4> for DSimilarity2x4
impl Mul<f64x4> for DSimilarity2x4
§type Output = DSimilarity2x4
type Output = DSimilarity2x4
*
operator.source§impl PartialEq<DSimilarity2x4> for DSimilarity2x4
impl PartialEq<DSimilarity2x4> for DSimilarity2x4
source§fn eq(&self, other: &DSimilarity2x4) -> bool
fn eq(&self, other: &DSimilarity2x4) -> bool
self
and other
values to be equal, and is used
by ==
.