Struct polystrip::vertex::Matrix4[][src]

#[repr(transparent)]pub struct Matrix4(pub ColumnMatrix4<f32>);

A 4 x 4 column major matrix in screen space

Implementations

impl Matrix4[src]

pub fn identity() -> Matrix4[src]

Returns the identity matrix.

pub fn translate(v: Vector2) -> Matrix4[src]

Returns a matrix that translates by the given X and Y values, in screen space

pub fn rotate(r: f32) -> Matrix4[src]

Returns a matrix that rotates the XY plane counterclockwise about the origin by the given angle.

Interprets the angle to be in radians.

pub fn scale(f: f32) -> Matrix4[src]

Returns a matrix that scales the XY plane by the given factor

pub fn scale_nonuniform(x: f32, y: f32) -> Matrix4[src]

Returns a matrix that scales the X coordinate by the given factor and the Y coordinate by the given factor.

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

Returns a simple perspective matrix from the four passed parameters. Equivalent to the gluPerspective function in OpenGL.

See also RendererBuilder::real_3d

Parameters

  • fovy: The angle of the field of view up and down, in radians. Must be nonzero and cannot be a multiple of tau (2π)
  • aspect: The ratio of screen width to screen height. Should be updated when the window is resized. Must be nonzero.
  • near: Distance from the camera to the near clipping plane, in screen-space coordinates.
  • far: Distance from the camera to the far clipping plane, in screen-space coordinates. Must not be equal to near.

pub fn row(&self, i: usize) -> [f32; 4][src]

Trait Implementations

impl Clone for Matrix4[src]

impl Copy for Matrix4[src]

impl Debug for Matrix4[src]

impl Deref for Matrix4[src]

type Target = ColumnMatrix4<f32>

The resulting type after dereferencing.

impl DerefMut for Matrix4[src]

impl From<[[f32; 4]; 4]> for Matrix4[src]

impl From<ColumnMatrix4<f32>> for Matrix4[src]

impl From<Matrix4> for ColumnMatrix4<f32>[src]

impl Mul<Matrix4> for Matrix4[src]

type Output = Matrix4

The resulting type after applying the * operator.

impl PartialEq<Matrix4> for Matrix4[src]

impl PartialOrd<Matrix4> for Matrix4[src]

impl Pod for Matrix4[src]

impl StructuralPartialEq for Matrix4[src]

impl Zeroable for Matrix4[src]

Auto Trait Implementations

impl RefUnwindSafe for Matrix4

impl Send for Matrix4

impl Sync for Matrix4

impl Unpin for Matrix4

impl UnwindSafe for Matrix4

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.