Struct ultraviolet::transform::Isometry3
source · #[repr(C)]pub struct Isometry3 {
pub translation: Vec3,
pub rotation: Rotor3,
}
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: Vec3
§rotation: Rotor3
Implementations§
source§impl Isometry3
impl Isometry3
pub const fn new(translation: Vec3, rotation: Rotor3) -> Self
pub fn identity() -> Self
sourcepub fn prepend_rotation(&mut self, rotor: Rotor3)
pub fn prepend_rotation(&mut self, rotor: Rotor3)
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: Rotor3)
pub fn append_rotation(&mut self, rotor: Rotor3)
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: Vec3)
pub fn prepend_translation(&mut self, translation: Vec3)
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: Vec3)
pub fn append_translation(&mut self, translation: Vec3)
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: Vec3) -> Vec3
pub fn into_homogeneous_matrix(self) -> Mat4
Trait Implementations§
source§impl<'de> Deserialize<'de> for Isometry3
impl<'de> Deserialize<'de> for Isometry3
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<Isometry3> for Isometry3
impl PartialEq<Isometry3> for Isometry3
impl Copy for Isometry3
impl Pod for Isometry3
impl StructuralPartialEq for Isometry3
Auto Trait Implementations§
impl RefUnwindSafe for Isometry3
impl Send for Isometry3
impl Sync for Isometry3
impl Unpin for Isometry3
impl UnwindSafe for Isometry3
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
.