[][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]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Transform[src]

Auto Trait Implementations

impl Send for Transform

impl Sync for Transform

Blanket Implementations

impl<T> From for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.