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