Struct Matrix4x4

Source
#[repr(C)]
pub struct Matrix4x4 { pub m: [[f32; 4]; 4], }

Fields§

§m: [[f32; 4]; 4]

Implementations§

Source§

impl Matrix4x4

Source

pub const fn identity() -> Matrix4x4

Source

pub fn get_row(self: &Matrix4x4, index: usize) -> Vector4

Return the given row of the matrix as a vector

Source

pub fn get_column(self: &Matrix4x4, index: usize) -> Vector4

Return the given column of the matrix as a vector

Source

pub fn transpose(self: &mut Matrix4x4)

Transpose the rows and columns of the matrix

Source

pub fn transposed(self: &Matrix4x4) -> Matrix4x4

Returns a transposed version of the matrix

Source

pub fn translation(translation: Vector3) -> Matrix4x4

Construct a translation matrix

Source

pub fn scale(scale: Vector3) -> Matrix4x4

Construct a scale matrix

Source

pub fn rotation(rotation: Quaternion) -> Matrix4x4

Construct a rotation matrix

Source

pub fn projection_ortho( left: f32, right: f32, top: f32, bottom: f32, near: f32, far: f32, ) -> Matrix4x4

Construct a new off-center orthographic projection matrix

Source

pub fn projection_ortho_aspect( aspect_ratio: f32, scale: f32, near: f32, far: f32, ) -> Matrix4x4

Construct a new orthographic projection matrix using the given aspect ratio, scale, and near/far plane clip distances

Source

pub fn projection_perspective( aspect_ratio: f32, field_of_view: f32, near: f32, far: f32, ) -> Matrix4x4

Construct a new perspective projection matrix using the given aspect ratio, field of view, and near/far plane clip distances

Source

pub fn load_identity_simd()

👎Deprecated since 0.1.16: Dreambox v2.x now directly supports compiling with SIMD intrinsics

Load an identity matrix into the SIMD register

Source

pub fn load_simd(matrix: &Matrix4x4)

👎Deprecated since 0.1.16: Dreambox v2.x now directly supports compiling with WASM SIMD intrinsics

Load a matrix into the SIMD register

Source

pub fn store_simd(matrix: &mut Matrix4x4)

👎Deprecated since 0.1.16: Dreambox v2.x now directly supports compiling with WASM SIMD intrinsics

Store the current value of the SIMD register to the given matrix

Source

pub fn mul_simd(matrix: &Matrix4x4)

👎Deprecated since 0.1.16: Dreambox v2.x now directly supports compiling with WASM SIMD intrinsics

Multiply the matrix in the SIMD register by the given matrix

Source

pub fn transform_vector_simd(data: &mut [Vector4])

👎Deprecated since 0.1.16: Dreambox v2.x now directly supports compiling with WASM SIMD intrinsics

Transform an array of vectors using the SIMD matrix register

Source

pub fn transform_vertex_simd<T>(data: &mut [T], field: FieldOffset<T, Vector4>)

👎Deprecated since 0.1.16: Dreambox v2.x now directly supports compiling with WASM SIMD intrinsics

Transform a field of an array of input vertex structs using the SIMD matrix register

Trait Implementations§

Source§

impl Add for Matrix4x4

Source§

type Output = Matrix4x4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Matrix4x4) -> Matrix4x4

Performs the + operation. Read more
Source§

impl Clone for Matrix4x4

Source§

fn clone(&self) -> Matrix4x4

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Matrix4x4

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Mul<Vector4> for Matrix4x4

Source§

type Output = Vector4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector4) -> Vector4

Performs the * operation. Read more
Source§

impl Mul<f32> for Matrix4x4

Source§

type Output = Matrix4x4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Matrix4x4

Performs the * operation. Read more
Source§

impl Mul for Matrix4x4

Source§

type Output = Matrix4x4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Matrix4x4) -> Matrix4x4

Performs the * operation. Read more
Source§

impl Sub for Matrix4x4

Source§

type Output = Matrix4x4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Matrix4x4) -> Matrix4x4

Performs the - operation. Read more
Source§

impl Copy for Matrix4x4

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.