[−][src]Struct ultraviolet::mat::Mat2
A 2x2 square matrix.
Useful for performing linear transformations (rotation, scaling) on 2d vectors.
Fields
cols: [Vec2; 2]
Methods
impl Mat2
[src]
pub fn new(col1: Vec2, col2: Vec2) -> Self
[src]
pub fn identity() -> Self
[src]
pub fn into_homogeneous(self) -> Mat3
[src]
Turn this into a homogeneous 2d transformation matrix.
pub fn layout() -> Layout
[src]
pub fn as_array(&self) -> &[f32; 4]
[src]
pub fn as_component_array(&self) -> &[Vec2; 2]
[src]
pub fn as_slice(&self) -> &[f32]
[src]
pub fn as_component_slice(&self) -> &[Vec2]
[src]
pub fn as_byte_slice(&self) -> &[u8]
[src]
pub fn as_mut_slice(&mut self) -> &mut [f32]
[src]
pub fn as_mut_component_slice(&mut self) -> &mut [Vec2]
[src]
pub fn as_mut_byte_slice(&mut self) -> &mut [u8]
[src]
Trait Implementations
impl Clone for Mat2
[src]
impl Copy for Mat2
[src]
impl Debug for Mat2
[src]
impl Default for Mat2
[src]
impl<'_> From<&'_ [f32; 4]> for Mat2
[src]
impl From<[f32; 4]> for Mat2
[src]
impl From<Rotor2> for Mat2
[src]
impl Index<usize> for Mat2
[src]
type Output = Vec2
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
impl IndexMut<usize> for Mat2
[src]
impl Mul<Mat2> for Mat2
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
impl Mul<Vec2> 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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,