Struct pax_runtime_api::math::Transform2
source · pub struct Transform2<WFrom = Generic, WTo = WFrom> { /* private fields */ }
Implementations§
source§impl<WFrom: Space, WTo: Space> Transform2<WFrom, WTo>
impl<WFrom: Space, WTo: Space> Transform2<WFrom, WTo>
pub fn new(m: [f64; 6]) -> Self
pub fn identity() -> Self
pub fn scale(s: f64) -> Self
pub fn rotate(th: f64) -> Self
pub fn translate(p: Vector2<WTo>) -> Self
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: Space, T: Space>(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.
Trait Implementations§
source§impl<T: Space, F: Space> From<Transform2<T, F>> for Affine
impl<T: Space, F: Space> From<Transform2<T, F>> for Affine
source§fn from(value: Transform2<T, F>) -> Self
fn from(value: Transform2<T, F>) -> Self
Converts to this type from the input type.
source§impl<F: Space, T: Space> Interpolatable for Transform2<F, T>
impl<F: Space, T: Space> Interpolatable for Transform2<F, T>
fn interpolate(&self, _other: &Self, _t: f64) -> Self
source§impl<W1: Space, W2: Space, W3: Space> Mul<Transform2<W1, W2>> for Transform2<W2, W3>
impl<W1: Space, W2: Space, W3: Space> 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§impl<F: Space, T: Space> PartialEq for Transform2<F, T>
impl<F: Space, T: Space> PartialEq for Transform2<F, T>
impl<F: Space, T: Space> Copy 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, 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.