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, W: Space> Into<Transform2<F, W>> for TransformParts
impl<F: Space, W: Space> Into<Transform2<F, W>> for TransformParts
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: Space, T: Space> Into<TransformParts> for Transform2<F, T>
NOTE: the returned parts.skew.y will always be equal to 0,
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
fn into(self) -> TransformParts
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>
Source§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§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.