Struct Transform2

Source
pub struct Transform2<WFrom = Generic, WTo = WFrom> {
    pub m: [f64; 6],
    /* private fields */
}

Fields§

§m: [f64; 6]

Implementations§

Source§

impl<WFrom: Space, WTo: Space> Transform2<WFrom, WTo>

Source

pub fn new(m: [f64; 6]) -> Self

Source

pub fn identity() -> Self

Source

pub fn scale(s: f64) -> Self

Source

pub fn scale_sep(s: Vector2<WTo>) -> Self

Source

pub fn skew(k: Vector2<WTo>) -> Self

Source

pub fn rotate(th: f64) -> Self

Source

pub fn translate(p: Vector2<WTo>) -> Self

Source

pub fn determinant(self) -> f64

Source

pub fn coeffs(&self) -> [f64; 6]

Source

pub fn get_translation(self) -> Vector2<WFrom>

Source

pub fn get_scale(self) -> Vector2<WTo>

Source

pub fn cast_spaces<W: Space, T: Space>(self) -> Transform2<W, T>

Source

pub fn inverse(self) -> Transform2<WTo, WFrom>

Produces NaN values when the determinant is zero.

Source

pub fn compose(p: Point2<WTo>, vx: Vector2<WTo>, vy: Vector2<WTo>) -> Self

Source

pub fn decompose(&self) -> (Point2<WTo>, Vector2<WTo>, Vector2<WTo>)

Source

pub fn contains_point(&self, point: Point2<WTo>) -> bool

Trait Implementations§

Source§

impl<F, T> Clone for Transform2<F, T>

Source§

fn clone(&self) -> Self

Returns a duplicate 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 CoercionRules for Transform2

Source§

impl<F, T> Debug for Transform2<F, T>

Source§

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

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

impl<F: Space, T: Space> Default for Transform2<F, T>

Source§

fn default() -> Self

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

impl<T: Space, F: Space> From<Transform2<T, F>> for Affine

Source§

fn from(value: Transform2<T, F>) -> Self

Converts to this type from the input type.
Source§

impl HelperFunctions for Transform2

Source§

impl<W: Space, T: Space> Interpolatable for Transform2<W, T>

Source§

fn interpolate(&self, other: &Self, t: f64) -> Self

Source§

impl<F: Space, W: Space> Into<Transform2<F, W>> for TransformParts

Source§

fn into(self) -> Transform2<F, W>

Converts this type into the (usually inferred) input type.
Source§

impl<F: Space, T: Space> Into<TransformParts> for Transform2<F, T>

NOTE: the returned parts.skew.y will always be equal to 0,

Source§

fn into(self) -> TransformParts

Converts this type into the (usually inferred) input type.
Source§

impl<F: Space, T: Space> Mul<Point2<F>> for Transform2<F, T>

Source§

type Output = Point2<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Point2<F>) -> Self::Output

Performs the * operation. Read more
Source§

impl<W1: Space, W2: Space, W3: Space> Mul<Transform2<W1, W2>> for Transform2<W2, W3>

Source§

type Output = Transform2<W1, W3>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Transform2<W1, W2>) -> Self::Output

Performs the * operation. Read more
Source§

impl<F: Space, T: Space> Mul<Vector2<F>> for Transform2<F, T>

Source§

type Output = Vector2<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Vector2<F>) -> Self::Output

Performs the * operation. Read more
Source§

impl<F, T> PartialEq for Transform2<F, T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToPaxValue for Transform2

Source§

impl<F, T> Copy for Transform2<F, T>

Source§

impl<F: Space, T: Space> ImplToFromPaxAny for Transform2<F, T>

Auto Trait Implementations§

§

impl<WFrom, WTo> Freeze for Transform2<WFrom, WTo>

§

impl<WFrom, WTo> RefUnwindSafe for Transform2<WFrom, WTo>
where WFrom: RefUnwindSafe, WTo: RefUnwindSafe,

§

impl<WFrom, WTo> Send for Transform2<WFrom, WTo>
where WFrom: Send, WTo: Send,

§

impl<WFrom, WTo> Sync for Transform2<WFrom, WTo>
where WFrom: Sync, WTo: Sync,

§

impl<WFrom, WTo> Unpin for Transform2<WFrom, WTo>
where WFrom: Unpin, WTo: Unpin,

§

impl<WFrom, WTo> UnwindSafe for Transform2<WFrom, WTo>
where WFrom: UnwindSafe, WTo: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> RoundFrom<T> for T

Source§

fn round_from(x: T) -> T

Performs the conversion.
Source§

impl<T, U> RoundInto<U> for T
where U: RoundFrom<T>,

Source§

fn round_into(self) -> U

Performs the conversion.
Source§

impl<T> ToFromPaxAny for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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> PropertyValue for T
where T: Default + Clone + Interpolatable + 'static,