[][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]

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]

returns moved matrix.

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

scales matrix by vector

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

returns matrix scaled by Vector around Vector

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

same as scaled_xy but scaling is homogenous

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

returns matrix rotated by angle around a point.

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

prj projects point by matrix

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

opposite of prj

Trait Implementations

impl Clone for Mat[src]

impl Copy for Mat[src]

impl Mul<Mat> for Mat[src]

type Output = Mat

The resulting type after applying the * operator.

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>,