Skip to main content

Matrix3

Struct Matrix3 

Source
pub struct Matrix3 {
    pub elements: [f64; 9],
}
Expand description

Port of three.js’ Matrix3: a 3x3 matrix.

Fields§

§elements: [f64; 9]

A column-major list of matrix values.

Implementations§

Source§

impl Matrix3

Source

pub const fn identity() -> Self

The identity matrix.

Source

pub fn set( &mut self, n11: f64, n12: f64, n13: f64, n21: f64, n22: f64, n23: f64, n31: f64, n32: f64, n33: f64, ) -> &mut Self

Matrix3.set( n11, n12, n13, n21, ... ) — row-order arguments into a column-major store, exactly as three.js writes them.

Source

pub fn set_from_matrix4(&mut self, m: &Matrix4) -> &mut Self

Matrix3.setFromMatrix4().

Source

pub fn invert(&mut self) -> &mut Self

Matrix3.invert().

Source

pub fn transpose(&mut self) -> &mut Self

Matrix3.transpose().

Source

pub fn get_normal_matrix(&mut self, m: &Matrix4) -> &mut Self

Matrix3.getNormalMatrix( matrix4 ).

Source

pub fn set_identity(&mut self) -> &mut Self

Matrix3.identity().

Source

pub fn copy(&mut self, m: &Self) -> &mut Self

Matrix3.copy().

Source

pub fn extract_basis( &self, x_axis: &mut Vector3, y_axis: &mut Vector3, z_axis: &mut Vector3, )

Matrix3.extractBasis().

Source

pub fn multiply(&mut self, m: &Self) -> &mut Self

Matrix3.multiply().

Source

pub fn premultiply(&mut self, m: &Self) -> &mut Self

Matrix3.premultiply().

Source

pub fn multiply_matrices(&mut self, a: &Self, b: &Self) -> &mut Self

Matrix3.multiplyMatrices().

Source

pub fn multiply_scalar(&mut self, s: f64) -> &mut Self

Matrix3.multiplyScalar().

Source

pub fn determinant(&self) -> f64

Matrix3.determinant().

Source

pub fn transpose_into_array(&self) -> [f64; 9]

Matrix3.transposeIntoArray().

Source

pub fn set_uv_transform( &mut self, tx: f64, ty: f64, sx: f64, sy: f64, rotation: f64, cx: f64, cy: f64, ) -> &mut Self

Matrix3.setUvTransform().

Source

pub fn make_translation(&mut self, x: f64, y: f64) -> &mut Self

Matrix3.makeTranslation().

Source

pub fn make_rotation(&mut self, theta: f64) -> &mut Self

Matrix3.makeRotation() — counter-clockwise.

Source

pub fn make_scale(&mut self, x: f64, y: f64) -> &mut Self

Matrix3.makeScale().

Source

pub fn equals(&self, m: &Self) -> bool

Matrix3.equals().

Source

pub fn from_array(&mut self, array: &[f64], offset: usize) -> &mut Self

Matrix3.fromArray().

Source

pub fn to_array(&self) -> [f64; 9]

Matrix3.toArray().

Trait Implementations§

Source§

impl Clone for Matrix3

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Matrix3

Source§

impl Debug for Matrix3

Source§

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

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

impl Default for Matrix3

Source§

fn default() -> Self

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

impl PartialEq for Matrix3

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Matrix3

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,