[][src]Struct window::Transform

#[repr(C)]pub struct Transform { /* fields omitted */ }

A 4x4 transformation matrix.

Implementations

impl Transform[src]

pub fn new() -> Self[src]

Create a new identity matrix (transform that does nothing).

pub fn from_mat4(mat: [[f32; 4]; 4]) -> Self[src]

Create a new Transform from a 4x4 matrix.

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

Scale transformation (make biggger or smaller).

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

Translate (move) transformation.

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

Rotate transformation. Parameters are quaternion in axis-angle form.

  • x: axis-vector x.
  • y: axis-vector y.
  • z: axis-vector z.
  • c: angle in cycles.

Trait Implementations

impl Clone for Transform[src]

impl Copy for Transform[src]

impl Default for Transform[src]

impl Mul<[f32; 3]> for Transform[src]

type Output = [f32; 3]

The resulting type after applying the * operator.

impl Mul<Transform> for Transform[src]

type Output = Transform

The resulting type after applying the * operator.

Auto Trait Implementations

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.