| 1 | // Generated from mat.rs.tera template. Edit the template, not the generated file. |
| 2 | |
| 3 | use craterust-analyzer cargo glam 0.25.0 crate/::{f32rust-analyzer cargo glam 0.25.0 f32/::mathrust-analyzer cargo glam 0.25.0 f32/math/, swizzlesrust-analyzer cargo glam 0.25.0 swizzles/::*, DMat3rust-analyzer cargo glam 0.25.0 f64/dmat3/DMat3#, EulerRotrust-analyzer cargo glam 0.25.0 euler/EulerRot#, Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#, Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#, Mat4rust-analyzer cargo glam 0.25.0 f32/sse2/mat4/Mat4#, Quatrust-analyzer cargo glam 0.25.0 f32/sse2/quat/Quat#, Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#, Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#}; |
| 4 | #[cfg(not(target_arch = "spirv"))] |
| 5 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/; |
| 6 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/::{Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product#, Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#}; |
| 7 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#, AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#, Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#, MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#, Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#, Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#, SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#}; |
| 8 | |
| 9 | /// Creates a 3x3 matrix from three column vectors. |
| 10 | #[inline(always)] |
| 11 | #[must_use] |
| 12 | pub const fn mat3rust-analyzer cargo glam 0.25.0 f32/mat3/mat3().(x_axis: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, y_axis: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, z_axis: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#) -> Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 13 | Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(x_axis, y_axis, z_axis) |
| 14 | } |
| 15 | |
| 16 | /// A 3x3 column major matrix. |
| 17 | /// |
| 18 | /// This 3x3 matrix type features convenience methods for creating and using linear and |
| 19 | /// affine transformations. If you are primarily dealing with 2D affine transformations the |
| 20 | /// [`Affine2`](crate::Affine2) type is much faster and more space efficient than |
| 21 | /// using a 3x3 matrix. |
| 22 | /// |
| 23 | /// Linear transformations including 3D rotation and scale can be created using methods |
| 24 | /// such as [`Self::from_diagonal()`], [`Self::from_quat()`], [`Self::from_axis_angle()`], |
| 25 | /// [`Self::from_rotation_x()`], [`Self::from_rotation_y()`], or |
| 26 | /// [`Self::from_rotation_z()`]. |
| 27 | /// |
| 28 | /// The resulting matrices can be use to transform 3D vectors using regular vector |
| 29 | /// multiplication. |
| 30 | /// |
| 31 | /// Affine transformations including 2D translation, rotation and scale can be created |
| 32 | /// using methods such as [`Self::from_translation()`], [`Self::from_angle()`], |
| 33 | /// [`Self::from_scale()`] and [`Self::from_scale_angle_translation()`]. |
| 34 | /// |
| 35 | /// The [`Self::transform_point2()`] and [`Self::transform_vector2()`] convenience methods |
| 36 | /// are provided for performing affine transforms on 2D vectors and points. These multiply |
| 37 | /// 2D inputs as 3D vectors with an implicit `z` value of `1` for points and `0` for |
| 38 | /// vectors respectively. These methods assume that `Self` contains a valid affine |
| 39 | /// transform. |
| 40 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)] |
| 41 | #[repr(C)] |
| 42 | pub struct Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 43 | pub x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, |
| 44 | pub y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, |
| 45 | pub z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, |
| 46 | } |
| 47 | |
| 48 | impl Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 49 | /// A 3x3 matrix with all elements set to `0.0`. |
| 50 | pub const ZEROrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]ZERO.: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::ZEROrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]ZERO., Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::ZEROrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]ZERO., Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::ZEROrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]ZERO.); |
| 51 | |
| 52 | /// A 3x3 identity matrix, where all diagonal elements are `1`, and all off-diagonal elements are `0`. |
| 53 | pub const IDENTITYrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]IDENTITY.: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Xrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]X., Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Yrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]Y., Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Zrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]Z.); |
| 54 | |
| 55 | /// All NAN:s. |
| 56 | pub const NANrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]NAN.: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::NANrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]NAN., Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::NANrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]NAN., Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::NANrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]NAN.); |
| 57 | |
| 58 | #[allow(clippy::too_many_arguments)] |
| 59 | #[inline(always)] |
| 60 | #[must_use] |
| 61 | const fn newrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]new().( |
| 62 | m00: f32, |
| 63 | m01: f32, |
| 64 | m02: f32, |
| 65 | m10: f32, |
| 66 | m11: f32, |
| 67 | m12: f32, |
| 68 | m20: f32, |
| 69 | m21: f32, |
| 70 | m22: f32, |
| 71 | ) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 72 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 73 | x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(m00, m01, m02), |
| 74 | y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(m10, m11, m12), |
| 75 | z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(m20, m21, m22), |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | /// Creates a 3x3 matrix from three column vectors. |
| 80 | #[inline(always)] |
| 81 | #[must_use] |
| 82 | pub const fn from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(x_axis: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, y_axis: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, z_axis: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 83 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 84 | x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis., |
| 85 | y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis., |
| 86 | z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis., |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /// Creates a 3x3 matrix from a `[f32; 9]` array stored in column major order. |
| 91 | /// If your data is stored in row major you will need to `transpose` the returned |
| 92 | /// matrix. |
| 93 | #[inline] |
| 94 | #[must_use] |
| 95 | pub const fn from_cols_arrayrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols_array().(m: &[f32; 9]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 96 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::newrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]new().(m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().5]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().) |
| 97 | } |
| 98 | |
| 99 | /// Creates a `[f32; 9]` array storing data in column major order. |
| 100 | /// If you require data in row major order `transpose` the matrix first. |
| 101 | #[inline] |
| 102 | #[must_use] |
| 103 | pub const fn to_cols_arrayrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]to_cols_array().(&self) -> [f32; 9] { |
| 104 | [ |
| 105 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x., |
| 106 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y., |
| 107 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z., |
| 108 | self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x., |
| 109 | self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y., |
| 110 | self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z., |
| 111 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x., |
| 112 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y., |
| 113 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z., |
| 114 | ] |
| 115 | } |
| 116 | |
| 117 | /// Creates a 3x3 matrix from a `[[f32; 3]; 3]` 3D array stored in column major order. |
| 118 | /// If your data is in row major order you will need to `transpose` the returned |
| 119 | /// matrix. |
| 120 | #[inline] |
| 121 | #[must_use] |
| 122 | pub const fn from_cols_array_2drust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols_array_2d().(m: &[[f32; 3]; 3]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 123 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 124 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::from_arrayrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]from_array().(m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().), |
| 125 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::from_arrayrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]from_array().(m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().), |
| 126 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::from_arrayrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]from_array().(m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().), |
| 127 | ) |
| 128 | } |
| 129 | |
| 130 | /// Creates a `[[f32; 3]; 3]` 3D array storing data in column major order. |
| 131 | /// If you require data in row major order `transpose` the matrix first. |
| 132 | #[inline] |
| 133 | #[must_use] |
| 134 | pub const fn to_cols_array_2drust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]to_cols_array_2d().(&self) -> [[f32; 3]; 3] { |
| 135 | [ |
| 136 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..to_arrayrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]to_array().(), |
| 137 | self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..to_arrayrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]to_array().(), |
| 138 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..to_arrayrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]to_array().(), |
| 139 | ] |
| 140 | } |
| 141 | |
| 142 | /// Creates a 3x3 matrix with its diagonal set to `diagonal` and all other entries set to 0. |
| 143 | #[doc(alias = "scale")] |
| 144 | #[inline] |
| 145 | #[must_use] |
| 146 | pub const fn from_diagonalrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_diagonal().(diagonal: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 147 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::newrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]new().( |
| 148 | diagonal.xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x., 0.0, 0.0, 0.0, diagonal.yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y., 0.0, 0.0, 0.0, diagonal.zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z., |
| 149 | ) |
| 150 | } |
| 151 | |
| 152 | /// Creates a 3x3 matrix from a 4x4 matrix, discarding the 4th row and column. |
| 153 | #[inline] |
| 154 | #[must_use] |
| 155 | pub fn from_mat4rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_mat4().(m: Mat4rust-analyzer cargo glam 0.25.0 f32/sse2/mat4/Mat4#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 156 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(m.x_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat4/Mat4#x_axis..xyzrust-analyzer cargo glam 0.25.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().(), m.y_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat4/Mat4#y_axis..xyzrust-analyzer cargo glam 0.25.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().(), m.z_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat4/Mat4#z_axis..xyzrust-analyzer cargo glam 0.25.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().()) |
| 157 | } |
| 158 | |
| 159 | /// Creates a 3D rotation matrix from the given quaternion. |
| 160 | /// |
| 161 | /// # Panics |
| 162 | /// |
| 163 | /// Will panic if `rotation` is not normalized when `glam_assert` is enabled. |
| 164 | #[inline] |
| 165 | #[must_use] |
| 166 | pub fn from_quatrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_quat().(rotation: Quatrust-analyzer cargo glam 0.25.0 f32/sse2/quat/Quat#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 167 | glam_assertrust-analyzer cargo glam 0.25.0 macros/glam_assert!!(rotation.is_normalized()); |
| 168 | |
| 169 | let x2 = rotation.xrust-analyzer cargo glam 0.25.0 deref/Vec4#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().rotation.xrust-analyzer cargo glam 0.25.0 deref/Vec4#x.; |
| 170 | let y2 = rotation.yrust-analyzer cargo glam 0.25.0 deref/Vec4#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().rotation.yrust-analyzer cargo glam 0.25.0 deref/Vec4#y.; |
| 171 | let z2 = rotation.zrust-analyzer cargo glam 0.25.0 deref/Vec4#z. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().rotation.zrust-analyzer cargo glam 0.25.0 deref/Vec4#z.; |
| 172 | let xx = rotation.xrust-analyzer cargo glam 0.25.0 deref/Vec4#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().x2; |
| 173 | let xy = rotation.xrust-analyzer cargo glam 0.25.0 deref/Vec4#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().y2; |
| 174 | let xz = rotation.xrust-analyzer cargo glam 0.25.0 deref/Vec4#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z2; |
| 175 | let yy = rotation.yrust-analyzer cargo glam 0.25.0 deref/Vec4#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().y2; |
| 176 | let yz = rotation.yrust-analyzer cargo glam 0.25.0 deref/Vec4#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z2; |
| 177 | let zz = rotation.zrust-analyzer cargo glam 0.25.0 deref/Vec4#z. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z2; |
| 178 | let wx = rotation.wrust-analyzer cargo glam 0.25.0 deref/Vec4#w. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().x2; |
| 179 | let wy = rotation.wrust-analyzer cargo glam 0.25.0 deref/Vec4#w. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().y2; |
| 180 | let wz = rotation.wrust-analyzer cargo glam 0.25.0 deref/Vec4#w. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z2; |
| 181 | |
| 182 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 183 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().(yy rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().zz), xy rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().wz, xz rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().wy), |
| 184 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(xy rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().wz, 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().(xx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().zz), yz rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().wx), |
| 185 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(xz rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().wy, yz rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().wx, 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().(xx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().yy)), |
| 186 | ) |
| 187 | } |
| 188 | |
| 189 | /// Creates a 3D rotation matrix from a normalized rotation `axis` and `angle` (in |
| 190 | /// radians). |
| 191 | /// |
| 192 | /// # Panics |
| 193 | /// |
| 194 | /// Will panic if `axis` is not normalized when `glam_assert` is enabled. |
| 195 | #[inline] |
| 196 | #[must_use] |
| 197 | pub fn from_axis_anglerust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_axis_angle().(axis: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#, angle: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 198 | glam_assertrust-analyzer cargo glam 0.25.0 macros/glam_assert!!(axis.is_normalized()); |
| 199 | |
| 200 | let (sin, cos) = mathrust-analyzer cargo glam 0.25.0 f32/math/::sin_cosrust-analyzer cargo glam 0.25.0 f32/math/std_math/sin_cos().(angle); |
| 201 | let (xsin, ysin, zsin) = axis.mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<f32>`]mul().(sin).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 202 | let (x, y, z) = axis.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 203 | let (x2, y2, z2) = axis.mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<Self>`]mul().(axis).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 204 | let omc = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().cos; |
| 205 | let xyomc = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc; |
| 206 | let xzomc = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc; |
| 207 | let yzomc = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc; |
| 208 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 209 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(x2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().cos, xyomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().zsin, xzomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().ysin), |
| 210 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(xyomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().zsin, y2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().cos, yzomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().xsin), |
| 211 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(xzomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().ysin, yzomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().xsin, z2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().cos), |
| 212 | ) |
| 213 | } |
| 214 | |
| 215 | /// Creates a 3D rotation matrix from the given euler rotation sequence and the angles (in |
| 216 | /// radians). |
| 217 | #[inline] |
| 218 | #[must_use] |
| 219 | pub fn from_eulerrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_euler().(order: EulerRotrust-analyzer cargo glam 0.25.0 euler/EulerRot#, a: f32, b: f32, c: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 220 | let quat = Quatrust-analyzer cargo glam 0.25.0 f32/sse2/quat/Quat#::from_eulerrust-analyzer cargo glam 0.25.0 f32/sse2/quat/impl#[Quat]from_euler().(order, a, b, c); |
| 221 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_quatrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_quat().(quat) |
| 222 | } |
| 223 | |
| 224 | /// Creates a 3D rotation matrix from `angle` (in radians) around the x axis. |
| 225 | #[inline] |
| 226 | #[must_use] |
| 227 | pub fn from_rotation_xrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_rotation_x().(angle: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 228 | let (sina, cosa) = mathrust-analyzer cargo glam 0.25.0 f32/math/::sin_cosrust-analyzer cargo glam 0.25.0 f32/math/std_math/sin_cos().(angle); |
| 229 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 230 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Xrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]X., |
| 231 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(0.0, cosa, sina), |
| 232 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().sina, cosa), |
| 233 | ) |
| 234 | } |
| 235 | |
| 236 | /// Creates a 3D rotation matrix from `angle` (in radians) around the y axis. |
| 237 | #[inline] |
| 238 | #[must_use] |
| 239 | pub fn from_rotation_yrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_rotation_y().(angle: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 240 | let (sina, cosa) = mathrust-analyzer cargo glam 0.25.0 f32/math/::sin_cosrust-analyzer cargo glam 0.25.0 f32/math/std_math/sin_cos().(angle); |
| 241 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 242 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(cosa, 0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().sina), |
| 243 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Yrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]Y., |
| 244 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(sina, 0.0, cosa), |
| 245 | ) |
| 246 | } |
| 247 | |
| 248 | /// Creates a 3D rotation matrix from `angle` (in radians) around the z axis. |
| 249 | #[inline] |
| 250 | #[must_use] |
| 251 | pub fn from_rotation_zrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_rotation_z().(angle: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 252 | let (sina, cosa) = mathrust-analyzer cargo glam 0.25.0 f32/math/::sin_cosrust-analyzer cargo glam 0.25.0 f32/math/std_math/sin_cos().(angle); |
| 253 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 254 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(cosa, sina, 0.0), |
| 255 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().sina, cosa, 0.0), |
| 256 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Zrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]Z., |
| 257 | ) |
| 258 | } |
| 259 | |
| 260 | /// Creates an affine transformation matrix from the given 2D `translation`. |
| 261 | /// |
| 262 | /// The resulting matrix can be used to transform 2D points and vectors. See |
| 263 | /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. |
| 264 | #[inline] |
| 265 | #[must_use] |
| 266 | pub fn from_translationrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_translation().(translation: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 267 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 268 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Xrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]X., |
| 269 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Yrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]Y., |
| 270 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(translation.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., translation.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y., 1.0), |
| 271 | ) |
| 272 | } |
| 273 | |
| 274 | /// Creates an affine transformation matrix from the given 2D rotation `angle` (in |
| 275 | /// radians). |
| 276 | /// |
| 277 | /// The resulting matrix can be used to transform 2D points and vectors. See |
| 278 | /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. |
| 279 | #[inline] |
| 280 | #[must_use] |
| 281 | pub fn from_anglerust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_angle().(angle: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 282 | let (sin, cos) = mathrust-analyzer cargo glam 0.25.0 f32/math/::sin_cosrust-analyzer cargo glam 0.25.0 f32/math/std_math/sin_cos().(angle); |
| 283 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(cos, sin, 0.0), Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().sin, cos, 0.0), Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Zrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]Z.) |
| 284 | } |
| 285 | |
| 286 | /// Creates an affine transformation matrix from the given 2D `scale`, rotation `angle` (in |
| 287 | /// radians) and `translation`. |
| 288 | /// |
| 289 | /// The resulting matrix can be used to transform 2D points and vectors. See |
| 290 | /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. |
| 291 | #[inline] |
| 292 | #[must_use] |
| 293 | pub fn from_scale_angle_translationrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_scale_angle_translation().(scale: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#, angle: f32, translation: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 294 | let (sin, cos) = mathrust-analyzer cargo glam 0.25.0 f32/math/::sin_cosrust-analyzer cargo glam 0.25.0 f32/math/std_math/sin_cos().(angle); |
| 295 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 296 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(cos rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().scale.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., sin rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().scale.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., 0.0), |
| 297 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().sin rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().scale.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y., cos rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().scale.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y., 0.0), |
| 298 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(translation.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., translation.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y., 1.0), |
| 299 | ) |
| 300 | } |
| 301 | |
| 302 | /// Creates an affine transformation matrix from the given non-uniform 2D `scale`. |
| 303 | /// |
| 304 | /// The resulting matrix can be used to transform 2D points and vectors. See |
| 305 | /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. |
| 306 | /// |
| 307 | /// # Panics |
| 308 | /// |
| 309 | /// Will panic if all elements of `scale` are zero when `glam_assert` is enabled. |
| 310 | #[inline] |
| 311 | #[must_use] |
| 312 | pub fn from_scalerust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_scale().(scale: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 313 | // Do not panic as long as any component is non-zero |
| 314 | glam_assertrust-analyzer cargo glam 0.25.0 macros/glam_assert!!(scale.cmpne(Vec2::ZERO).any()); |
| 315 | |
| 316 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 317 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(scale.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., 0.0, 0.0), |
| 318 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(0.0, scale.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y., 0.0), |
| 319 | Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Zrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]Z., |
| 320 | ) |
| 321 | } |
| 322 | |
| 323 | /// Creates an affine transformation matrix from the given 2x2 matrix. |
| 324 | /// |
| 325 | /// The resulting matrix can be used to transform 2D points and vectors. See |
| 326 | /// [`Self::transform_point2()`] and [`Self::transform_vector2()`]. |
| 327 | #[inline] |
| 328 | pub fn from_mat2rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_mat2().(m: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 329 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().((m.x_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#x_axis., 0.0).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), (m.y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis., 0.0).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::Zrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]Z.) |
| 330 | } |
| 331 | |
| 332 | /// Creates a 3x3 matrix from the first 9 values in `slice`. |
| 333 | /// |
| 334 | /// # Panics |
| 335 | /// |
| 336 | /// Panics if `slice` is less than 9 elements long. |
| 337 | #[inline] |
| 338 | #[must_use] |
| 339 | pub const fn from_cols_slicerust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols_slice().(slice: &[f32]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 340 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::newrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]new().( |
| 341 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().5]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 342 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., |
| 343 | ) |
| 344 | } |
| 345 | |
| 346 | /// Writes the columns of `self` to the first 9 elements in `slice`. |
| 347 | /// |
| 348 | /// # Panics |
| 349 | /// |
| 350 | /// Panics if `slice` is less than 9 elements long. |
| 351 | #[inline] |
| 352 | pub fn write_cols_to_slicerust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]write_cols_to_slice().(self, slice: &mut [f32]) { |
| 353 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x.; |
| 354 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y.; |
| 355 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z.; |
| 356 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x.; |
| 357 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y.; |
| 358 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().5]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z.; |
| 359 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x.; |
| 360 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().7]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y.; |
| 361 | slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().8]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z.; |
| 362 | } |
| 363 | |
| 364 | /// Returns the matrix column for the given `index`. |
| 365 | /// |
| 366 | /// # Panics |
| 367 | /// |
| 368 | /// Panics if `index` is greater than 2. |
| 369 | #[inline] |
| 370 | #[must_use] |
| 371 | pub fn colrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]col().(&self, index: usize) -> Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3# { |
| 372 | match index { |
| 373 | 0 => self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis., |
| 374 | 1 => self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis., |
| 375 | 2 => self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis., |
| 376 | _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"), |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | /// Returns a mutable reference to the matrix column for the given `index`. |
| 381 | /// |
| 382 | /// # Panics |
| 383 | /// |
| 384 | /// Panics if `index` is greater than 2. |
| 385 | #[inline] |
| 386 | pub fn col_mutrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]col_mut().(&mut self, index: usize) -> &mut Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3# { |
| 387 | match index { |
| 388 | 0 => &mut self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis., |
| 389 | 1 => &mut self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis., |
| 390 | 2 => &mut self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis., |
| 391 | _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"), |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | /// Returns the matrix row for the given `index`. |
| 396 | /// |
| 397 | /// # Panics |
| 398 | /// |
| 399 | /// Panics if `index` is greater than 2. |
| 400 | #[inline] |
| 401 | #[must_use] |
| 402 | pub fn rowrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]row().(&self, index: usize) -> Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3# { |
| 403 | match index { |
| 404 | 0 => Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x., self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x., self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x.), |
| 405 | 1 => Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y., self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y., self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y.), |
| 406 | 2 => Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z., self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z., self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z.), |
| 407 | _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"), |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | /// Returns `true` if, and only if, all elements are finite. |
| 412 | /// If any element is either `NaN`, positive or negative infinity, this will return `false`. |
| 413 | #[inline] |
| 414 | #[must_use] |
| 415 | pub fn is_finiterust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]is_finite().(&self) -> bool { |
| 416 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..is_finiterust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]is_finite().() && self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..is_finiterust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]is_finite().() && self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..is_finiterust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]is_finite().() |
| 417 | } |
| 418 | |
| 419 | /// Returns `true` if any elements are `NaN`. |
| 420 | #[inline] |
| 421 | #[must_use] |
| 422 | pub fn is_nanrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]is_nan().(&self) -> bool { |
| 423 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..is_nanrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]is_nan().() || self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..is_nanrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]is_nan().() || self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..is_nanrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]is_nan().() |
| 424 | } |
| 425 | |
| 426 | /// Returns the transpose of `self`. |
| 427 | #[inline] |
| 428 | #[must_use] |
| 429 | pub fn transposerust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]transpose().(&self) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 430 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 431 | x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x., self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x., self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x.), |
| 432 | y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y., self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y., self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y.), |
| 433 | z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]new().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z., self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z., self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z.), |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | /// Returns the determinant of `self`. |
| 438 | #[inline] |
| 439 | #[must_use] |
| 440 | pub fn determinantrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]determinant().(&self) -> f32 { |
| 441 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..dotrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]dot().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..crossrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]cross().(self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.)) |
| 442 | } |
| 443 | |
| 444 | /// Returns the inverse of `self`. |
| 445 | /// |
| 446 | /// If the matrix is not invertible the returned matrix will be invalid. |
| 447 | /// |
| 448 | /// # Panics |
| 449 | /// |
| 450 | /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled. |
| 451 | #[inline] |
| 452 | #[must_use] |
| 453 | pub fn inverserust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]inverse().(&self) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 454 | let tmp0 = self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..crossrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]cross().(self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.); |
| 455 | let tmp1 = self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..crossrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]cross().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.); |
| 456 | let tmp2 = self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..crossrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]cross().(self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.); |
| 457 | let det = self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..dotrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]dot().(tmp2); |
| 458 | glam_assertrust-analyzer cargo glam 0.25.0 macros/glam_assert!!(det != 0.0); |
| 459 | let inv_det = Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#::splatrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]splat().(det.reciprust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]recip().()); |
| 460 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(tmp0.mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<Self>`]mul().(inv_det), tmp1.mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<Self>`]mul().(inv_det), tmp2.mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<Self>`]mul().(inv_det)).transposerust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]transpose().() |
| 461 | } |
| 462 | |
| 463 | /// Transforms the given 2D vector as a point. |
| 464 | /// |
| 465 | /// This is the equivalent of multiplying `rhs` as a 3D vector where `z` is `1`. |
| 466 | /// |
| 467 | /// This method assumes that `self` contains a valid affine transform. |
| 468 | /// |
| 469 | /// # Panics |
| 470 | /// |
| 471 | /// Will panic if the 2nd row of `self` is not `(0, 0, 1)` when `glam_assert` is enabled. |
| 472 | #[inline] |
| 473 | #[must_use] |
| 474 | pub fn transform_point2rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]transform_point2().(&self, rhs: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2# { |
| 475 | glam_assertrust-analyzer cargo glam 0.25.0 macros/glam_assert!!(self.row(2).abs_diff_eq(Vec3::Z, 1e-6)); |
| 476 | Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_colsrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/vec3_impl/impl#[Vec3][Vec3Swizzles]xy().(), self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/vec3_impl/impl#[Vec3][Vec3Swizzles]xy().()) rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().rhs rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add().+rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add(). rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add().self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/vec3_impl/impl#[Vec3][Vec3Swizzles]xy().() |
| 477 | } |
| 478 | |
| 479 | /// Rotates the given 2D vector. |
| 480 | /// |
| 481 | /// This is the equivalent of multiplying `rhs` as a 3D vector where `z` is `0`. |
| 482 | /// |
| 483 | /// This method assumes that `self` contains a valid affine transform. |
| 484 | /// |
| 485 | /// # Panics |
| 486 | /// |
| 487 | /// Will panic if the 2nd row of `self` is not `(0, 0, 1)` when `glam_assert` is enabled. |
| 488 | #[inline] |
| 489 | #[must_use] |
| 490 | pub fn transform_vector2rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]transform_vector2().(&self, rhs: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2# { |
| 491 | glam_assertrust-analyzer cargo glam 0.25.0 macros/glam_assert!!(self.row(2).abs_diff_eq(Vec3::Z, 1e-6)); |
| 492 | Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_colsrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/vec3_impl/impl#[Vec3][Vec3Swizzles]xy().(), self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/vec3_impl/impl#[Vec3][Vec3Swizzles]xy().()) rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().rhs |
| 493 | } |
| 494 | |
| 495 | /// Transforms a 3D vector. |
| 496 | #[inline] |
| 497 | #[must_use] |
| 498 | pub fn mul_vec3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_vec3().(&self, rhs: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#) -> Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3# { |
| 499 | let mut res = self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<f32>`]mul().(rhs.xrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#x.); |
| 500 | res = res.addrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Add<Self>`]add().(self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<f32>`]mul().(rhs.yrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#y.)); |
| 501 | res = res.addrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Add<Self>`]add().(self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<f32>`]mul().(rhs.zrust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#z.)); |
| 502 | res |
| 503 | } |
| 504 | |
| 505 | /// Transforms a [`Vec3A`]. |
| 506 | #[inline] |
| 507 | #[must_use] |
| 508 | pub fn mul_vec3arust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_vec3a().(&self, rhs: Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#) -> Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A# { |
| 509 | self.mul_vec3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_vec3().(rhs.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 510 | } |
| 511 | |
| 512 | /// Multiplies two 3x3 matrices. |
| 513 | #[inline] |
| 514 | #[must_use] |
| 515 | pub fn mul_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_mat3().(&self, rhs: &Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 516 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 517 | self.mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Vec3>`]mul().(rhs.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.), |
| 518 | self.mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Vec3>`]mul().(rhs.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.), |
| 519 | self.mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Vec3>`]mul().(rhs.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.), |
| 520 | ) |
| 521 | } |
| 522 | |
| 523 | /// Adds two 3x3 matrices. |
| 524 | #[inline] |
| 525 | #[must_use] |
| 526 | pub fn add_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]add_mat3().(&self, rhs: &Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 527 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 528 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..addrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Add<Self>`]add().(rhs.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.), |
| 529 | self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..addrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Add<Self>`]add().(rhs.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.), |
| 530 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..addrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Add<Self>`]add().(rhs.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.), |
| 531 | ) |
| 532 | } |
| 533 | |
| 534 | /// Subtracts two 3x3 matrices. |
| 535 | #[inline] |
| 536 | #[must_use] |
| 537 | pub fn sub_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]sub_mat3().(&self, rhs: &Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 538 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 539 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..subrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Sub<Self>`]sub().(rhs.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.), |
| 540 | self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..subrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Sub<Self>`]sub().(rhs.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.), |
| 541 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..subrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Sub<Self>`]sub().(rhs.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.), |
| 542 | ) |
| 543 | } |
| 544 | |
| 545 | /// Multiplies a 3x3 matrix by a scalar. |
| 546 | #[inline] |
| 547 | #[must_use] |
| 548 | pub fn mul_scalarrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_scalar().(&self, rhs: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3] { |
| 549 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 550 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<f32>`]mul().(rhs), |
| 551 | self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<f32>`]mul().(rhs), |
| 552 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..mulrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`Mul<f32>`]mul().(rhs), |
| 553 | ) |
| 554 | } |
| 555 | |
| 556 | /// Returns true if the absolute difference of all elements between `self` and `rhs` |
| 557 | /// is less than or equal to `max_abs_diff`. |
| 558 | /// |
| 559 | /// This can be used to compare if two matrices contain similar elements. It works best |
| 560 | /// when comparing with a known value. The `max_abs_diff` that should be used used |
| 561 | /// depends on the values being compared against. |
| 562 | /// |
| 563 | /// For more see |
| 564 | /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). |
| 565 | #[inline] |
| 566 | #[must_use] |
| 567 | pub fn abs_diff_eqrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]abs_diff_eq().(&self, rhs: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3], max_abs_diff: f32) -> bool { |
| 568 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..abs_diff_eqrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]abs_diff_eq().(rhs.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis., max_abs_diff) |
| 569 | && self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..abs_diff_eqrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]abs_diff_eq().(rhs.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis., max_abs_diff) |
| 570 | && self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..abs_diff_eqrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]abs_diff_eq().(rhs.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis., max_abs_diff) |
| 571 | } |
| 572 | |
| 573 | #[inline] |
| 574 | pub fn as_dmat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]as_dmat3().(&self) -> DMat3rust-analyzer cargo glam 0.25.0 f64/dmat3/DMat3# { |
| 575 | DMat3rust-analyzer cargo glam 0.25.0 f64/dmat3/DMat3#::from_colsrust-analyzer cargo glam 0.25.0 f64/dmat3/impl#[DMat3]from_cols().( |
| 576 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..as_dvec3rust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]as_dvec3().(), |
| 577 | self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..as_dvec3rust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]as_dvec3().(), |
| 578 | self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..as_dvec3rust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3]as_dvec3().(), |
| 579 | ) |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 584 | #[inline] |
| 585 | fn defaultrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Default]default().() -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Default] { |
| 586 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Default]::IDENTITYrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]IDENTITY. |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 591 | type Outputrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Add<Self>`]Output# = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Add<Self>`]; |
| 592 | #[inline] |
| 593 | fn addrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Add<Self>`]add().(self, rhs: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Add<Self>`]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Add<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output# { |
| 594 | self.add_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]add_mat3().(&rhs) |
| 595 | } |
| 596 | } |
| 597 | |
| 598 | impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#<Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 599 | #[inline] |
| 600 | fn add_assignrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`AddAssign<Self>`]add_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`AddAssign<Self>`]) { |
| 601 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.add_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]add_mat3().(&rhs); |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 606 | type Outputrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sub<Self>`]Output# = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sub<Self>`]; |
| 607 | #[inline] |
| 608 | fn subrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sub<Self>`]sub().(self, rhs: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sub<Self>`]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sub<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output# { |
| 609 | self.sub_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]sub_mat3().(&rhs) |
| 610 | } |
| 611 | } |
| 612 | |
| 613 | impl SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#<Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 614 | #[inline] |
| 615 | fn sub_assignrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`SubAssign<Self>`]sub_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`SubAssign<Self>`]) { |
| 616 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.sub_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]sub_mat3().(&rhs); |
| 617 | } |
| 618 | } |
| 619 | |
| 620 | impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 621 | type Outputrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Neg]Output# = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Neg]; |
| 622 | #[inline] |
| 623 | fn negrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Neg]neg().(self) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Neg]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#Output# { |
| 624 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Neg]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().(self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..negrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][Neg]neg().(), self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..negrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][Neg]neg().(), self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..negrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][Neg]neg().()) |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 629 | type Outputrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]Output# = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]; |
| 630 | #[inline] |
| 631 | fn mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul().(self, rhs: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 632 | self.mul_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_mat3().(&rhs) |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 637 | #[inline] |
| 638 | fn mul_assignrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`MulAssign<Self>`]mul_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`MulAssign<Self>`]) { |
| 639 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.mul_mat3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_mat3().(&rhs); |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 644 | type Outputrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Vec3>`]Output# = Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#; |
| 645 | #[inline] |
| 646 | fn mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Vec3>`]mul().(self, rhs: Vec3rust-analyzer cargo glam 0.25.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Vec3>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 647 | self.mul_vec3rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_vec3().(rhs) |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#> for f32 { |
| 652 | type Outputrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[f32][`Mul<Mat3>`]Output# = Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#; |
| 653 | #[inline] |
| 654 | fn mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[f32][`Mul<Mat3>`]mul().(self, rhs: Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[f32][`Mul<Mat3>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 655 | rhs.mul_scalarrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_scalar().(self) |
| 656 | } |
| 657 | } |
| 658 | |
| 659 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<f32> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 660 | type Outputrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<f32>`]Output# = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<f32>`]; |
| 661 | #[inline] |
| 662 | fn mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<f32>`]mul().(self, rhs: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<f32>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 663 | self.mul_scalarrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_scalar().(rhs) |
| 664 | } |
| 665 | } |
| 666 | |
| 667 | impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<f32> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 668 | #[inline] |
| 669 | fn mul_assignrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`MulAssign<f32>`]mul_assign().(&mut self, rhs: f32) { |
| 670 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.mul_scalarrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_scalar().(rhs); |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 675 | type Outputrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Vec3A>`]Output# = Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#; |
| 676 | #[inline] |
| 677 | fn mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Vec3A>`]mul().(self, rhs: Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#) -> Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A# { |
| 678 | self.mul_vec3arust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]mul_vec3a().(rhs) |
| 679 | } |
| 680 | } |
| 681 | |
| 682 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 683 | #[inline] |
| 684 | fn fromrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`From<Mat3A>`]from().(m: Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`From<Mat3A>`] { |
| 685 | Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`From<Mat3A>`] { |
| 686 | x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.: m.x_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#x_axis..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 687 | y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.: m.y_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#y_axis..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 688 | z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.: m.z_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#z_axis..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 689 | } |
| 690 | } |
| 691 | } |
| 692 | |
| 693 | impl Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#<Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<Self>`]> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 694 | fn sumrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<Self>`]sum().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<Self>`] |
| 695 | where |
| 696 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<Self>`]>, |
| 697 | { |
| 698 | iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<Self>`]::ZEROrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]ZERO., Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<Self>`]::addrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Add<Self>`]add().) |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | impl<'a> Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#<&'a Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<&'a Mat3>`]> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 703 | fn sumrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<&'a Mat3>`]sum().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<&'a Mat3>`] |
| 704 | where |
| 705 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<&'a Mat3>`]>, |
| 706 | { |
| 707 | iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<&'a Mat3>`]::ZEROrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]ZERO., |a, &b| Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Sum<&'a Mat3>`]::addrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Add<Self>`]add().(a, b)) |
| 708 | } |
| 709 | } |
| 710 | |
| 711 | impl Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product# for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 712 | fn productrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<Self>`]product().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<Self>`] |
| 713 | where |
| 714 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<Self>`]>, |
| 715 | { |
| 716 | iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<Self>`]::IDENTITYrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]IDENTITY., Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<Self>`]::mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul().) |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | impl<'a> Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product#<&'a Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<&'a Mat3>`]> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 721 | fn productrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<&'a Mat3>`]product().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<&'a Mat3>`] |
| 722 | where |
| 723 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<&'a Mat3>`]>, |
| 724 | { |
| 725 | iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<&'a Mat3>`]::IDENTITYrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]IDENTITY., |a, &b| Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Product<&'a Mat3>`]::mulrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul().(a, b)) |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 730 | #[inline] |
| 731 | fn eqrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`PartialEq<Self>`]eq().(&self, rhs: &Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`PartialEq<Self>`]) -> bool { |
| 732 | self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..eqrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`PartialEq<Self>`]eq().(&rhs.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.) && self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..eqrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`PartialEq<Self>`]eq().(&rhs.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.) && self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..eqrust-analyzer cargo glam 0.25.0 f32/vec3/impl#[Vec3][`PartialEq<Self>`]eq().(&rhs.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.) |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | #[cfg(not(target_arch = "spirv"))] |
| 737 | impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<[f32; 9]> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 738 | #[inline] |
| 739 | fn as_refrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`AsRef<[f32; 9]>`]as_ref().(&self) -> &[f32; 9] { |
| 740 | unsafe { &*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().(self as *const Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`AsRef<[f32; 9]>`] as *const [f32; 9]) } |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | #[cfg(not(target_arch = "spirv"))] |
| 745 | impl AsMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsMut#<[f32; 9]> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 746 | #[inline] |
| 747 | fn as_mutrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`AsMut<[f32; 9]>`]as_mut().(&mut self) -> &mut [f32; 9] { |
| 748 | unsafe { &mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().(self as *mut Selfrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`AsMut<[f32; 9]>`] as *mut [f32; 9]) } |
| 749 | } |
| 750 | } |
| 751 | |
| 752 | #[cfg(not(target_arch = "spirv"))] |
| 753 | impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 754 | fn fmtrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Debug]fmt().(&self, fmt: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 755 | fmt.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().(stringifyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/stringify!!(Mat3)) |
| 756 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("x_axis", &self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis.) |
| 757 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("y_axis", &self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis.) |
| 758 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("z_axis", &self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.) |
| 759 | .finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().() |
| 760 | } |
| 761 | } |
| 762 | |
| 763 | #[cfg(not(target_arch = "spirv"))] |
| 764 | impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 765 | fn fmtrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 766 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "[{}, {}, {}]", self.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis., self.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis., self.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis.) |
| 767 | } |
| 768 | } |