#[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

source

pub const fn new(translation: Vec2, rotation: Rotor2) -> Self

source

pub fn identity() -> Self

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn inverse(&mut self)

source

pub fn inversed(self) -> Self

source

pub fn transform_vec(&self, vec: Vec2) -> Vec2

source

pub fn into_homogeneous_matrix(self) -> Mat3

Trait Implementations§

source§

impl Add<Isometry2> for Isometry2

§

type Output = Isometry2

The resulting type after applying the + operator.
source§

fn add(self, other: Isometry2) -> Isometry2

Performs the + operation. Read more
source§

impl Clone for Isometry2

source§

fn clone(&self) -> Isometry2

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Isometry2

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Isometry2

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Isometry2

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Mul<Isometry2> for Isometry2

§

type Output = Isometry2

The resulting type after applying the * operator.
source§

fn mul(self, base: Isometry2) -> Isometry2

Performs the * operation. Read more
source§

impl Mul<Isometry2> for Rotor2

§

type Output = Isometry2

The resulting type after applying the * operator.
source§

fn mul(self, iso: Isometry2) -> Isometry2

Performs the * operation. Read more
source§

impl Mul<Rotor2> for Isometry2

§

type Output = Isometry2

The resulting type after applying the * operator.
source§

fn mul(self, rotor: Rotor2) -> Isometry2

Performs the * operation. Read more
source§

impl Mul<Vec2> for Isometry2

§

type Output = Vec2

The resulting type after applying the * operator.
source§

fn mul(self, vec: Vec2) -> Vec2

Performs the * operation. Read more
source§

impl Mul<f32> for Isometry2

§

type Output = Isometry2

The resulting type after applying the * operator.
source§

fn mul(self, scalar: f32) -> Isometry2

Performs the * operation. Read more
source§

impl PartialEq<Isometry2> for Isometry2

source§

fn eq(&self, other: &Isometry2) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Isometry2

source§

fn serialize<T>(&self, serializer: T) -> Result<T::Ok, T::Error>where T: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Zeroable for Isometry2

source§

fn zeroed() -> Self

source§

impl Copy for Isometry2

source§

impl Pod for Isometry2

source§

impl StructuralPartialEq for Isometry2

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,

§

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

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AnyBitPattern for Twhere T: Pod,

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<T> NoUninit for Twhere T: Pod,