Struct ultraviolet::transform::Isometry2
source · #[repr(C)]pub struct Isometry2 {
pub translation: Vec2,
pub rotation: Rotor2,
}
Expand description
An Isometry, aka a “rigid body transformation”.
Defined as the combination of a rotation and then 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: Vec2
§rotation: Rotor2
Implementations§
source§impl Isometry2
impl Isometry2
pub const fn new(translation: Vec2, rotation: Rotor2) -> Self
pub fn identity() -> Self
sourcepub fn prepend_rotation(&mut self, rotor: Rotor2)
pub fn prepend_rotation(&mut self, rotor: Rotor2)
Add a rotation before this isometry.
This means the rotation will only affect the rotational part of this isometry, not the translational part.
sourcepub fn append_rotation(&mut self, rotor: Rotor2)
pub fn append_rotation(&mut self, rotor: Rotor2)
Add a rotation after this isometry.
This means the rotation will affect both the rotational and translational parts of this isometry, since it is being applied ‘after’ this isometry’s translational part.
sourcepub fn prepend_translation(&mut self, translation: Vec2)
pub fn prepend_translation(&mut self, translation: Vec2)
Add a translation before this isometry.
Doing so will mean that the translation being added will get transformed by this isometry’s rotational part.
sourcepub fn append_translation(&mut self, translation: Vec2)
pub fn append_translation(&mut self, translation: Vec2)
Add a translation after this isometry.
Doing so will mean that the translation being added will not transformed by this isometry’s rotational part.
sourcepub fn prepend_isometry(&mut self, other: Self)
pub fn prepend_isometry(&mut self, other: Self)
Prepend transformation by another isometry.
This means that the transformation being applied will take place before this isometry, i.e. both its translation and rotation will be rotated by this isometry’s rotational part.
sourcepub fn append_isometry(&mut self, other: Self)
pub fn append_isometry(&mut self, other: Self)
Append transformation by another isometry.
This means that the transformation being applied will take place after this isometry, i.e. this isometry’s translation and rotation will be rotated by the other isometry’s rotational part.
pub fn inverse(&mut self)
pub fn inversed(self) -> Self
pub fn transform_vec(&self, vec: Vec2) -> Vec2
pub fn into_homogeneous_matrix(self) -> Mat3
Trait Implementations§
source§impl<'de> Deserialize<'de> for Isometry2
impl<'de> Deserialize<'de> for Isometry2
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
source§impl PartialEq<Isometry2> for Isometry2
impl PartialEq<Isometry2> for Isometry2
impl Copy for Isometry2
impl Pod for Isometry2
impl StructuralPartialEq for Isometry2
Auto Trait Implementations§
impl RefUnwindSafe for Isometry2
impl Send for Isometry2
impl Sync for Isometry2
impl Unpin for Isometry2
impl UnwindSafe for Isometry2
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
.