[][src]Struct bevy::prelude::LocalTransform

pub struct LocalTransform(pub Mat4);

Implementations

impl LocalTransform[src]

Methods from Deref<Target = Mat4>

pub fn to_cols_array(&self) -> [f32; 16][src]

Creates a [f32; 16] storing data in column major order. If you require data in row major order transpose the matrix first.

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

Creates a [[f32; 4]; 4] storing data in column major order. If you require data in row major order transpose the matrix first.

pub fn to_scale_rotation_translation(&self) -> (Vec3, Quat, Vec3)[src]

Extracts scale, rotation and translation from self. The input matrix is expected to be a 4x4 homogeneous transformation matrix otherwise the output will be invalid.

pub fn set_x_axis(&mut self, x: Vec4)[src]

pub fn set_y_axis(&mut self, y: Vec4)[src]

pub fn set_z_axis(&mut self, z: Vec4)[src]

pub fn set_w_axis(&mut self, w: Vec4)[src]

pub fn x_axis(&self) -> Vec4[src]

pub fn y_axis(&self) -> Vec4[src]

pub fn z_axis(&self) -> Vec4[src]

pub fn w_axis(&self) -> Vec4[src]

pub fn transpose(&self) -> Mat4[src]

Returns the transpose of self.

pub fn determinant(&self) -> f32[src]

Returns the determinant of self.

pub fn inverse(&self) -> Mat4[src]

Returns the inverse of self.

If the matrix is not invertible the returned matrix will be invalid.

pub fn mul_vec4(&self, other: Vec4) -> Vec4[src]

pub fn mul_mat4(&self, other: &Mat4) -> Mat4[src]

Multiplies two 4x4 matrices.

pub fn add_mat4(&self, other: &Mat4) -> Mat4[src]

pub fn sub_mat4(&self, other: &Mat4) -> Mat4[src]

pub fn mul_scalar(&self, other: f32) -> Mat4[src]

pub fn transform_point3(&self, other: Vec3) -> Vec3[src]

Transforms the given Vec3 as 3D point. This is the equivalent of multiplying the Vec3 as a Vec4 where w is 1.0.

pub fn transform_vector3(&self, other: Vec3) -> Vec3[src]

Transforms the give Vec3 as 3D vector. This is the equivalent of multiplying the Vec3 as a Vec4 where w is 0.0.

pub fn abs_diff_eq(&self, other: Mat4, max_abs_diff: f32) -> bool[src]

Returns true if the absolute difference of all elements between self and other is less than or equal to max_abs_diff.

This can be used to compare if two Mat4's contain similar elements. It works best when comparing with a known value. The max_abs_diff that should be used used depends on the values being compared against.

For more on floating point comparisons see https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

Trait Implementations

impl Clone for LocalTransform[src]

impl Copy for LocalTransform[src]

impl Debug for LocalTransform[src]

impl Default for LocalTransform[src]

impl Deref for LocalTransform[src]

type Target = Mat4

The resulting type after dereferencing.

impl DerefMut for LocalTransform[src]

impl DeserializeProperty for LocalTransform[src]

impl Display for LocalTransform[src]

impl PartialEq<LocalTransform> for LocalTransform[src]

impl Properties for LocalTransform[src]

impl Property for LocalTransform[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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

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

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> FromResources for T where
    T: Default
[src]

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

impl<P> PropertiesVal for P where
    P: Properties
[src]

impl<T> Resource for T where
    T: 'static + Send + Sync
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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<V, T> VZip<V> for T where
    V: MultiLane<T>,