[][src]Struct rask_engine::math::Mat2

pub struct Mat2 { /* fields omitted */ }

A 2x2 matrix with f32 elements.

Implementations

impl Mat2[src]

pub const fn new(a: f32, b: f32, c: f32, d: f32) -> Self[src]

Creates a new Mat2 of the form: (a b) (c d)

pub const fn from_vec2(v1: Vec2, v2: Vec2) -> Self[src]

Creates a new Mat2 from two column Vec2s.

pub const fn zero() -> Self[src]

Returns the zero matrix.

pub const fn identity() -> Self[src]

Returns the identity matrix.

pub fn rotation(angle: f32) -> Self[src]

Returns a matrix that rotates by angle.

pub const fn scaling(scale_x: f32, scale_y: f32) -> Self[src]

Returns a matrix that scales by scale_x and scale_y.

pub const fn transpose(self) -> Self[src]

Returns the transposed matrix.

Trait Implementations

impl Add<Mat2> for Mat2[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Mat2> for Mat2[src]

impl AsRef<[f32; 4]> for Mat2[src]

impl Clone for Mat2[src]

impl Copy for Mat2[src]

impl Debug for Mat2[src]

impl Default for Mat2[src]

impl Div<f32> for Mat2[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<f32> for Mat2[src]

impl Eq for Mat2[src]

impl Mul<Mat2> for f32[src]

type Output = Mat2

The resulting type after applying the * operator.

impl Mul<Mat2> for Mat2[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<Vec2> for Mat2[src]

type Output = Vec2

The resulting type after applying the * operator.

impl Mul<f32> for Mat2[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<Mat2> for Mat2[src]

impl MulAssign<f32> for Mat2[src]

impl Neg for Mat2[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Mat2> for Mat2[src]

impl Sub<Mat2> for Mat2[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Mat2> for Mat2[src]

Auto Trait Implementations

impl RefUnwindSafe for Mat2

impl Send for Mat2

impl Sync for Mat2

impl Unpin for Mat2

impl UnwindSafe for Mat2

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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

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

impl<S, T> Collide<[T]> for S where
    T: Collide<S>, 
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Resource for T where
    T: Any + Send + Sync

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryDefault for T where
    T: Default

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.