Struct dbsdk_rs::math::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 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()

Load an identity matrix into the SIMD register

source

pub fn load_simd(matrix: &Matrix4x4)

Load a matrix into the SIMD register

source

pub fn store_simd(matrix: &mut Matrix4x4)

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

source

pub fn mul_simd(matrix: &Matrix4x4)

Multiply the matrix in the SIMD register by the given matrix

source

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

Transform an array of vectors using the SIMD matrix register

source

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

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

Trait Implementations§

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 Mul<Vector4> for Matrix4x4

§

type Output = Vector4

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Copy for Matrix4x4

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.