Struct pax_runtime_api::math::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>
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 scale_sep(s: Vector2<WTo>) -> Self
pub fn skew(k: Vector2<WTo>) -> 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.
pub fn compose(p: Point2<WTo>, vx: Vector2<WTo>, vy: Vector2<WTo>) -> Self
pub fn decompose(&self) -> (Point2<WTo>, Vector2<WTo>, Vector2<WTo>)
pub fn contains_point(&self, point: Point2<WTo>) -> bool
Trait Implementations§
source§impl<F, T> Clone for Transform2<F, T>
impl<F, T> Clone for Transform2<F, T>
source§impl CoercionRules for Transform2
impl CoercionRules for Transform2
source§impl<F, T> Debug for Transform2<F, T>
impl<F, T> Debug for Transform2<F, T>
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<W: Space, T: Space> Interpolatable for Transform2<W, T>
impl<W: Space, T: Space> Interpolatable for Transform2<W, T>
fn interpolate(&self, _other: &Self, _t: f64) -> Self
source§impl<F: Space, T: Space> Into<Parts> for Transform2<F, T>
impl<F: Space, T: Space> Into<Parts> for Transform2<F, T>
NOTE: the returned parts.skew.y will always be equal to 0,
source§impl<F: Space, W: Space> Into<Transform2<F, W>> for Parts
impl<F: Space, W: Space> 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<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, T> PartialEq for Transform2<F, T>
impl<F, T> PartialEq for Transform2<F, T>
source§impl ToPaxValue for Transform2
impl ToPaxValue for Transform2
fn to_pax_value(self) -> PaxValue
impl<F, T> Copy for Transform2<F, T>
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>
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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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, 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.