pub struct Matrix {
pub m00: f32,
pub m10: f32,
pub m01: f32,
pub m11: f32,
pub m02: f32,
pub m12: f32,
}
Expand description
A 2D transform matrix. *
Fields
m00: f32
m10: f32
m01: f32
m11: f32
m02: f32
m12: f32
Implementations
sourceimpl Matrix
impl Matrix
pub fn new() -> Matrix
pub fn set(
&mut self,
m00: f32,
m10: f32,
m01: f32,
m11: f32,
m02: f32,
m12: f32
)
sourcepub fn compose(
&mut self,
x: f32,
y: f32,
scale_x: f32,
scale_y: f32,
rotation: f32
)
pub fn compose(
&mut self,
x: f32,
y: f32,
scale_x: f32,
scale_y: f32,
rotation: f32
)
Set this matrix to a translation, scale, and rotation, in that order.
pub fn translate(&mut self, x: f32, y: f32)
pub fn scale(&mut self, x: f32, y: f32)
pub fn rotate(&mut self, rotation: f32)
pub fn transform(&self, x: f32, y: f32) -> Point2<f32>
pub fn transform_array(
&self,
points: Vec<f32, Global>,
length: usize,
result: &mut Vec<f32, Global>
)
sourcepub fn determinant(&self) -> f32
pub fn determinant(&self) -> f32
Calculate the determinant of this matrix.
Trait Implementations
impl Copy for Matrix
Auto Trait Implementations
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnwindSafe for Matrix
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.