[][src]Enum gltf::scene::Transform

pub enum Transform {
    Matrix {
        matrix: [[f32; 4]; 4],
    },
    Decomposed {
        translation: [f32; 3],
        rotation: [f32; 4],
        scale: [f32; 3],
    },
}

The transform for a Node.

Variants

Matrix

4x4 transformation matrix in column-major order.

Fields of Matrix

matrix: [[f32; 4]; 4]

4x4 matrix.

Decomposed

Decomposed TRS properties.

Fields of Decomposed

translation: [f32; 3]

[x, y, z] vector.

rotation: [f32; 4]

[x, y, z, w] quaternion, where w is the scalar.

scale: [f32; 3]

[x, y, z] vector.

Methods

impl Transform[src]

pub fn matrix(self) -> [[f32; 4]; 4][src]

Returns the matrix representation of this transform.

If the transform is Decomposed, then the matrix is generated with the equation matrix = translation * rotation * scale.

pub fn decomposed(self) -> ([f32; 3], [f32; 4], [f32; 3])[src]

Returns a decomposed representation of this transform.

If the transform is Matrix, then the decomposition is extracted from the matrix.

Trait Implementations

impl Clone for Transform[src]

impl Debug for Transform[src]

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.