Struct Matrix4x3

Source
#[repr(C)]
pub struct Matrix4x3 { pub x: Vec3A, pub y: Vec3A, pub z: Vec3A, pub w: Vec3A, }
Expand description

A Matrix with 4 columns of Vec3, very similar to glam’s Affine3A.

Primarily used in ray tracing extensions to represent object rotation, scale and translation.

Fields§

§x: Vec3A§y: Vec3A§z: Vec3A§w: Vec3A

Implementations§

Source§

impl Matrix4x3

The from_* fn signatures should match Affine3A, to make it easier to switch to Affine3A later. The to_* fn signatures are custom

Source

pub fn from_affine3a(affine: Affine3A) -> Self

Convert from glam’s Affine3A

Source

pub fn from_mat3(mat3: Mat3) -> Self

Creates an affine transform from a 3x3 matrix (expressing scale, shear and rotation)

Source

pub fn from_mat3_translation(mat3: Mat3, translation: Vec3) -> Self

Creates an affine transform from a 3x3 matrix (expressing scale, shear and rotation) and a translation vector.

Equivalent to Affine3A::from_translation(translation) * Affine3A::from_mat3(mat3)

Source

pub fn from_mat4(m: Mat4) -> Self

The given Mat4 must be an affine transform, i.e. contain no perspective transform.

Source

pub fn to_affine3a(self) -> Affine3A

Convert to glam’s Affine3A

Source

pub fn to_mat3a(self) -> Mat3A

Creates a 3x3 matrix representing the rotation and scale, cutting off the translation

Source

pub fn to_mat3(self) -> Mat3

Creates a 3x3 matrix representing the rotation and scale, cutting off the translation

Source

pub fn to_mat4(self) -> Mat4

Creates a 4x4 matrix from this affine transform

Trait Implementations§

Source§

impl Clone for Matrix4x3

Source§

fn clone(&self) -> Matrix4x3

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Matrix4x3

Source§

fn default() -> Matrix4x3

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Matrix4x3

Source§

fn eq(&self, other: &Matrix4x3) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Matrix4x3

Source§

impl StructuralPartialEq for Matrix4x3

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.