[][src]Struct transform_matrix::Transform

pub struct Transform { /* fields omitted */ }

Methods

impl Transform[src]

pub fn new() -> Self[src]

Begins a new transformation

Note: The transformation starts as an identity matrix

pub fn translate(self, x: f32, y: f32, z: f32) -> Self[src]

Adds a translation transformation

Arguments

  • x - Amount by which to move on the x-axis

  • y - Amount by which to move on the y-axis

  • z - Amount by which to move on the z-axis

pub fn scale(self, x: f32, y: f32, z: f32) -> Self[src]

Adds a scale transformation

Arguments

  • x - Amount by which to scale on the x-axis

  • y - Amount by which to scale on the y-axis

  • z - Amount by which to scale on the z-axis

pub fn rotate(self, x: f32, y: f32, z: f32) -> Self[src]

Adds a rotation transformation

Arguments

  • x - Amount by which to rotate on the x-axis

  • y - Amount by which to rotate on the y-axis

  • z - Amount by which to rotate on the z-axis

pub fn orthographic(self, width: f32, height: f32, depth: f32) -> [[f32; 4]; 4][src]

Adds an orthographic projection transformation

Arguments

  • width - Size of the view on the x-axis

  • height - Size of the view on the y-axis

  • depth - Size of the view on the z-axis

Note: This is the last step of the transformation and returns the matrix

Trait Implementations

impl Default for Transform[src]

Auto Trait Implementations

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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