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
impl Matrix3
Sourcepub fn set(
&mut self,
n11: f64,
n12: f64,
n13: f64,
n21: f64,
n22: f64,
n23: f64,
n31: f64,
n32: f64,
n33: f64,
) -> &mut Self
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.
Sourcepub fn set_from_matrix4(&mut self, m: &Matrix4) -> &mut Self
pub fn set_from_matrix4(&mut self, m: &Matrix4) -> &mut Self
Matrix3.setFromMatrix4().
Sourcepub fn get_normal_matrix(&mut self, m: &Matrix4) -> &mut Self
pub fn get_normal_matrix(&mut self, m: &Matrix4) -> &mut Self
Matrix3.getNormalMatrix( matrix4 ).
Sourcepub fn set_identity(&mut self) -> &mut Self
pub fn set_identity(&mut self) -> &mut Self
Matrix3.identity().
Sourcepub fn extract_basis(
&self,
x_axis: &mut Vector3,
y_axis: &mut Vector3,
z_axis: &mut Vector3,
)
pub fn extract_basis( &self, x_axis: &mut Vector3, y_axis: &mut Vector3, z_axis: &mut Vector3, )
Matrix3.extractBasis().
Sourcepub fn premultiply(&mut self, m: &Self) -> &mut Self
pub fn premultiply(&mut self, m: &Self) -> &mut Self
Matrix3.premultiply().
Sourcepub fn multiply_matrices(&mut self, a: &Self, b: &Self) -> &mut Self
pub fn multiply_matrices(&mut self, a: &Self, b: &Self) -> &mut Self
Matrix3.multiplyMatrices().
Sourcepub fn multiply_scalar(&mut self, s: f64) -> &mut Self
pub fn multiply_scalar(&mut self, s: f64) -> &mut Self
Matrix3.multiplyScalar().
Sourcepub fn determinant(&self) -> f64
pub fn determinant(&self) -> f64
Matrix3.determinant().
Sourcepub fn transpose_into_array(&self) -> [f64; 9]
pub fn transpose_into_array(&self) -> [f64; 9]
Matrix3.transposeIntoArray().
Sourcepub fn set_uv_transform(
&mut self,
tx: f64,
ty: f64,
sx: f64,
sy: f64,
rotation: f64,
cx: f64,
cy: f64,
) -> &mut Self
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().
Sourcepub fn make_translation(&mut self, x: f64, y: f64) -> &mut Self
pub fn make_translation(&mut self, x: f64, y: f64) -> &mut Self
Matrix3.makeTranslation().
Sourcepub fn make_rotation(&mut self, theta: f64) -> &mut Self
pub fn make_rotation(&mut self, theta: f64) -> &mut Self
Matrix3.makeRotation() — counter-clockwise.
Sourcepub fn make_scale(&mut self, x: f64, y: f64) -> &mut Self
pub fn make_scale(&mut self, x: f64, y: f64) -> &mut Self
Matrix3.makeScale().
Sourcepub fn from_array(&mut self, array: &[f64], offset: usize) -> &mut Self
pub fn from_array(&mut self, array: &[f64], offset: usize) -> &mut Self
Matrix3.fromArray().
Trait Implementations§
impl Copy for Matrix3
impl StructuralPartialEq for Matrix3
Auto Trait Implementations§
impl Freeze for Matrix3
impl RefUnwindSafe for Matrix3
impl Send for Matrix3
impl Sync for Matrix3
impl Unpin for Matrix3
impl UnsafeUnpin for Matrix3
impl UnwindSafe for Matrix3
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more