[][src]Struct rustbatch::math::mat::Mat

pub struct Mat {
    pub x: Vect,
    pub y: Vect,
    pub c: Vect,
}

mat is 3 x 3 matrix used for 2D transformations. Simples explanation i can coe up with: 3x3 matrix is vector trio where x is vector describing x axis and y is describing y axis c is determining where these two axises intersect. Matrix is something like a custom coordinate system. To convert point from classic coordinate system to matrix coordinates you use prj method. Don't worry though if you do not understand. Matrix in this package is just optional interface you may or may not use. All it does are slightly more complex transformations.

Fields

x: Vecty: Vectc: Vect

Implementations

impl Mat[src]

pub const IM: Mat[src]

pub const ZM: Mat[src]

pub fn new(pos: Vect, scl: Vect, rot: f32) -> Mat[src]

new is matrix constructor

pub fn to_glm_mat4(&self) -> Mat4[src]

to_glm_mat4 turns Mat to glm::Mat4 for internal purposes

pub fn moved(self, delta: Vect) -> Mat[src]

pub fn sxy(&mut self, scl: Vect)[src]

pub fn scaled_xy(self, around: Vect, scl: Vect) -> Mat[src]

pub fn scaled(self, around: Vect, scl: f32) -> Mat[src]

pub fn rotated(self, around: Vect, ang: f32) -> Mat[src]

pub fn chained(&self, o: &Mat) -> Mat[src]

pub fn prj(&self, u: Vect) -> Vect[src]

pub fn unprj(&self, u: Vect) -> Vect[src]

Trait Implementations

impl Clone for Mat[src]

impl Copy for Mat[src]

Auto Trait Implementations

impl RefUnwindSafe for Mat

impl Send for Mat

impl Sync for Mat

impl Unpin for Mat

impl UnwindSafe for Mat

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,