pub struct Matrix {
pub a: f32,
pub b: f32,
pub c: f32,
pub d: f32,
pub e: f32,
pub f: f32,
}
Expand description
A row-major 3x3 matrix used for representing transformations of coordinates
Fields§
§a: f32
§b: f32
§c: f32
§d: f32
§e: f32
§f: f32
Implementations§
source§impl Matrix
impl Matrix
pub const IDENTITY: Matrix = _
pub fn new(a: f32, b: f32, c: f32, d: f32, e: f32, f: f32) -> Self
pub fn new_scale(x: f32, y: f32) -> Self
pub fn new_translate(x: f32, y: f32) -> Self
pub fn new_rotate(degrees: f32) -> Self
pub fn concat(&mut self, m: Matrix) -> &mut Self
pub fn scale(&mut self, sx: f32, sy: f32) -> &mut Self
pub fn rotate(&mut self, degrees: f32) -> &mut Self
pub fn pre_translate(&mut self, x: f32, y: f32) -> &mut Self
pub fn pre_shear(&mut self, h: f32, v: f32) -> &mut Self
Trait Implementations§
source§impl PartialEq for Matrix
impl PartialEq for Matrix
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnwindSafe for Matrix
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