[][src]Struct window::Transform

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

A 4x4 transformation matrix.

Methods

impl Transform[src]

pub fn new() -> Self[src]

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

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, c: 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.

pub fn perspective(fovy: f32, aspect: f32, near: f32, far: f32) -> Self[src]

Create a perspective matrix.

  • fovy - Y dimension field of view (in cycles), 0.25 is standard domain: 0 < fovy < 0.5
  • aspect - window_height / window_width
  • near - Near clipping pane, domain: 0 < near
  • far - Far clipping pane, domain: near < far

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, U> Into<U> for T where
    U: From<T>, 
[src]

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

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

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