Struct ultraviolet::transform::Similarity3
source · #[repr(C)]pub struct Similarity3 {
pub translation: Vec3,
pub rotation: Rotor3,
pub scale: f32,
}
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: Vec3
§rotation: Rotor3
§scale: f32
Implementations§
source§impl Similarity3
impl Similarity3
pub const fn new(translation: Vec3, rotation: Rotor3, scale: f32) -> Self
pub fn identity() -> Self
sourcepub fn prepend_scaling(&mut self, scaling: f32)
pub fn prepend_scaling(&mut self, scaling: f32)
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: f32)
pub fn append_scaling(&mut self, scaling: f32)
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: Rotor3)
pub fn prepend_rotation(&mut self, rotor: Rotor3)
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: Rotor3)
pub fn append_rotation(&mut self, rotor: Rotor3)
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: Vec3)
pub fn prepend_translation(&mut self, translation: Vec3)
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: Vec3)
pub fn append_translation(&mut self, translation: Vec3)
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: Vec3) -> Vec3
pub fn into_homogeneous_matrix(self) -> Mat4
Trait Implementations§
source§impl Add<Similarity3> for Similarity3
impl Add<Similarity3> for Similarity3
§type Output = Similarity3
type Output = Similarity3
+
operator.source§fn add(self, other: Similarity3) -> Similarity3
fn add(self, other: Similarity3) -> Similarity3
+
operation. Read moresource§impl Clone for Similarity3
impl Clone for Similarity3
source§fn clone(&self) -> Similarity3
fn clone(&self) -> Similarity3
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Similarity3
impl Debug for Similarity3
source§impl Default for Similarity3
impl Default for Similarity3
source§impl Mul<Rotor3> for Similarity3
impl Mul<Rotor3> for Similarity3
§type Output = Similarity3
type Output = Similarity3
*
operator.source§impl Mul<Similarity3> for Rotor3
impl Mul<Similarity3> for Rotor3
§type Output = Similarity3
type Output = Similarity3
*
operator.source§fn mul(self, iso: Similarity3) -> Similarity3
fn mul(self, iso: Similarity3) -> Similarity3
*
operation. Read moresource§impl Mul<Similarity3> for Similarity3
impl Mul<Similarity3> for Similarity3
§type Output = Similarity3
type Output = Similarity3
*
operator.source§fn mul(self, base: Similarity3) -> Similarity3
fn mul(self, base: Similarity3) -> Similarity3
*
operation. Read moresource§impl Mul<Vec3> for Similarity3
impl Mul<Vec3> for Similarity3
source§impl Mul<f32> for Similarity3
impl Mul<f32> for Similarity3
§type Output = Similarity3
type Output = Similarity3
*
operator.source§impl PartialEq<Similarity3> for Similarity3
impl PartialEq<Similarity3> for Similarity3
source§fn eq(&self, other: &Similarity3) -> bool
fn eq(&self, other: &Similarity3) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for Similarity3
impl Pod for Similarity3
impl StructuralPartialEq for Similarity3
Auto Trait Implementations§
impl RefUnwindSafe for Similarity3
impl Send for Similarity3
impl Sync for Similarity3
impl Unpin for Similarity3
impl UnwindSafe for Similarity3
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.