Struct immi::Matrix [] [src]

pub struct Matrix(pub [[f32; 2]; 3]);

A 2x3 matrix. The data is stored in column-major.

Methods

impl Matrix
[src]

fn identity() -> Matrix

Builds an identity matrix, in other words a matrix that has no effect.

fn scale(factor: f32) -> Matrix

Builds a matrix that will rescale both width and height of a given factor.

fn scale_wh(w: f32, h: f32) -> Matrix

Builds a matrix that will multiply the width and height by a certain factor.

fn translate(x: f32, y: f32) -> Matrix

Builds a matrix that will translate the object.

fn rotate(radians: f32) -> Matrix

Builds a matrix that will rotate the object.

fn skew_x(radians: f32) -> Matrix

Builds a matrix that will skew the x coordinate by a certain angle.

fn invert(&self) -> Option<[[f32; 3]; 3]>

Builds the matrix's invert.

Returns None if the determinant is zero, infinite or NaN.

Trait Implementations

impl PartialEq for Matrix
[src]

fn eq(&self, __arg_0: &Matrix) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Matrix) -> bool

This method tests for !=.

impl Debug for Matrix
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for Matrix
[src]

fn clone(&self) -> Matrix

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for Matrix
[src]

impl Mul for Matrix
[src]

type Output = Matrix

The resulting type after applying the * operator

fn mul(self, other: Matrix) -> Matrix

The method for the * operator

impl Mul<[f32; 3]> for Matrix
[src]

type Output = [f32; 3]

The resulting type after applying the * operator

fn mul(self, other: [f32; 3]) -> [f32; 3]

The method for the * operator

impl Into<[[f32; 3]; 3]> for Matrix
[src]

fn into(self) -> [[f32; 3]; 3]

Performs the conversion.

impl Into<[[f32; 4]; 4]> for Matrix
[src]

fn into(self) -> [[f32; 4]; 4]

Performs the conversion.