Struct pax_runtime::api::math::Transform2
source · pub struct Transform2<WFrom = Generic, WTo = WFrom> { /* private fields */ }
Implementations§
source§impl<WFrom, WTo> Transform2<WFrom, WTo>
impl<WFrom, WTo> Transform2<WFrom, WTo>
pub fn new(m: [f64; 6]) -> Transform2<WFrom, WTo>
pub fn identity() -> Transform2<WFrom, WTo>
pub fn scale(s: f64) -> Transform2<WFrom, WTo>
pub fn scale_sep(s: Vector2<WTo>) -> Transform2<WFrom, WTo>
pub fn skew(k: Vector2<WTo>) -> Transform2<WFrom, WTo>
pub fn rotate(th: f64) -> Transform2<WFrom, WTo>
pub fn translate(p: Vector2<WTo>) -> Transform2<WFrom, WTo>
pub fn determinant(self) -> f64
pub fn coeffs(&self) -> [f64; 6]
pub fn get_translation(self) -> Vector2<WFrom>
pub fn get_scale(self) -> Vector2<WTo>
pub fn cast_spaces<W, T>(self) -> Transform2<W, T>
sourcepub fn inverse(self) -> Transform2<WTo, WFrom>
pub fn inverse(self) -> Transform2<WTo, WFrom>
Produces NaN values when the determinant is zero.
pub fn compose( p: Point2<WTo>, vx: Vector2<WTo>, vy: Vector2<WTo>, ) -> Transform2<WFrom, WTo>
pub fn decompose(&self) -> (Point2<WTo>, Vector2<WTo>, Vector2<WTo>)
Trait Implementations§
source§impl<F, T> Clone for Transform2<F, T>
impl<F, T> Clone for Transform2<F, T>
source§fn clone(&self) -> Transform2<F, T>
fn clone(&self) -> Transform2<F, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<F, T> Debug for Transform2<F, T>
impl<F, T> Debug for Transform2<F, T>
source§impl<F, T> Default for Transform2<F, T>
impl<F, T> Default for Transform2<F, T>
source§fn default() -> Transform2<F, T>
fn default() -> Transform2<F, T>
Returns the “default value” for a type. Read more
source§impl<T, F> From<Transform2<T, F>> for Affine
impl<T, F> From<Transform2<T, F>> for Affine
source§fn from(value: Transform2<T, F>) -> Affine
fn from(value: Transform2<T, F>) -> Affine
Converts to this type from the input type.
source§impl<W, T> Interpolatable for Transform2<W, T>
impl<W, T> Interpolatable for Transform2<W, T>
fn interpolate(&self, _other: &Self, _t: f64) -> Self
source§impl<F, T> Into<Parts> for Transform2<F, T>
impl<F, T> Into<Parts> for Transform2<F, T>
NOTE: the returned parts.skew.y will always be equal to 0,
source§impl<F, W> Into<Transform2<F, W>> for Parts
impl<F, W> Into<Transform2<F, W>> for Parts
source§fn into(self) -> Transform2<F, W>
fn into(self) -> Transform2<F, W>
Converts this type into the (usually inferred) input type.
source§impl<F, T> Mul<Point2<F>> for Transform2<F, T>
impl<F, T> Mul<Point2<F>> for Transform2<F, T>
source§impl<W1, W2, W3> Mul<Transform2<W1, W2>> for Transform2<W2, W3>
impl<W1, W2, W3> Mul<Transform2<W1, W2>> for Transform2<W2, W3>
§type Output = Transform2<W1, W3>
type Output = Transform2<W1, W3>
The resulting type after applying the
*
operator.source§fn mul(
self,
rhs: Transform2<W1, W2>,
) -> <Transform2<W2, W3> as Mul<Transform2<W1, W2>>>::Output
fn mul( self, rhs: Transform2<W1, W2>, ) -> <Transform2<W2, W3> as Mul<Transform2<W1, W2>>>::Output
Performs the
*
operation. Read moresource§impl<F, T> Mul<Vector2<F>> for Transform2<F, T>
impl<F, T> Mul<Vector2<F>> for Transform2<F, T>
source§impl<F, T> PartialEq for Transform2<F, T>
impl<F, T> PartialEq for Transform2<F, T>
source§fn eq(&self, other: &Transform2<F, T>) -> bool
fn eq(&self, other: &Transform2<F, T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<F, T> Copy for Transform2<F, T>
impl<F, T> 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>
impl<WFrom, WTo> Sync for Transform2<WFrom, WTo>
impl<WFrom, WTo> Unpin for Transform2<WFrom, WTo>
impl<WFrom, WTo> UnwindSafe for Transform2<WFrom, WTo>where
WFrom: UnwindSafe,
WTo: UnwindSafe,
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CoercionRules for Twhere
T: ImplToFromPaxAny,
impl<T> CoercionRules for Twhere
T: ImplToFromPaxAny,
source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.