| 1 | // Generated from affine.rs.tera template. Edit the template, not the generated file. |
| 2 | |
| 3 | use craterust-analyzer cargo glam 0.25.0 crate/::{Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#, Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#, Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#, Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#, Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#}; |
| 4 | 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/::{Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#, DerefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/DerefMut#, 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#}; |
| 5 | |
| 6 | /// A 2D affine transform, which can represent translation, rotation, scaling and shear. |
| 7 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 8 | #[repr(C)] |
| 9 | pub struct Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 10 | pub matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#, |
| 11 | pub translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#, |
| 12 | } |
| 13 | |
| 14 | impl Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 15 | /// The degenerate zero transform. |
| 16 | /// |
| 17 | /// This transforms any finite vector and point to zero. |
| 18 | /// The zero transform is non-invertible. |
| 19 | pub const ZEROrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]ZERO.: Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] = Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 20 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::ZEROrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]ZERO., |
| 21 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::ZEROrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]ZERO., |
| 22 | }; |
| 23 | |
| 24 | /// The identity transform. |
| 25 | /// |
| 26 | /// Multiplying a vector with this returns the same vector. |
| 27 | pub const IDENTITYrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]IDENTITY.: Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] = Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 28 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::IDENTITYrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]IDENTITY., |
| 29 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::ZEROrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]ZERO., |
| 30 | }; |
| 31 | |
| 32 | /// All NAN:s. |
| 33 | pub const NANrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]NAN.: Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] = Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 34 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::NANrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]NAN., |
| 35 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::NANrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]NAN., |
| 36 | }; |
| 37 | |
| 38 | /// Creates an affine transform from three column vectors. |
| 39 | #[inline(always)] |
| 40 | #[must_use] |
| 41 | pub const fn from_colsrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_cols().(x_axis: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#, y_axis: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#, z_axis: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 42 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 43 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_colsrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols().(x_axis, y_axis), |
| 44 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: z_axis, |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | /// Creates an affine transform from a `[f32; 6]` array stored in column major order. |
| 49 | #[inline] |
| 50 | #[must_use] |
| 51 | pub fn from_cols_arrayrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_cols_array().(m: &[f32; 6]) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 52 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 53 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_cols_slicerust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols_slice().(&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/range/Range#4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().), |
| 54 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::from_slicerust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]from_slice().(&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/range/Range#6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().), |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | /// Creates a `[f32; 6]` array storing data in column major order. |
| 59 | #[inline] |
| 60 | #[must_use] |
| 61 | pub fn to_cols_arrayrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]to_cols_array().(&self) -> [f32; 6] { |
| 62 | let x = &self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..x_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#x_axis.; |
| 63 | let y = &self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis.; |
| 64 | let z = &self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.; |
| 65 | [x.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., x.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y., y.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., y.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y., z.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., z.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y.] |
| 66 | } |
| 67 | |
| 68 | /// Creates an affine transform from a `[[f32; 2]; 3]` |
| 69 | /// 2D array stored in column major order. |
| 70 | /// If your data is in row major order you will need to `transpose` the returned |
| 71 | /// matrix. |
| 72 | #[inline] |
| 73 | #[must_use] |
| 74 | pub fn from_cols_array_2drust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_cols_array_2d().(m: &[[f32; 2]; 3]) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 75 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 76 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_colsrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols().(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()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), 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()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), |
| 77 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: 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()..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /// Creates a `[[f32; 2]; 3]` 2D array storing data in |
| 82 | /// column major order. |
| 83 | /// If you require data in row major order `transpose` the matrix first. |
| 84 | #[inline] |
| 85 | #[must_use] |
| 86 | pub fn to_cols_array_2drust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]to_cols_array_2d().(&self) -> [[f32; 2]; 3] { |
| 87 | [ |
| 88 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..x_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#x_axis..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 89 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 90 | self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 91 | ] |
| 92 | } |
| 93 | |
| 94 | /// Creates an affine transform from the first 6 values in `slice`. |
| 95 | /// |
| 96 | /// # Panics |
| 97 | /// |
| 98 | /// Panics if `slice` is less than 6 elements long. |
| 99 | #[inline] |
| 100 | #[must_use] |
| 101 | pub fn from_cols_slicerust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_cols_slice().(slice: &[f32]) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 102 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 103 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_cols_slicerust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols_slice().(&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/range/Range#4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().), |
| 104 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::from_slicerust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]from_slice().(&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/range/Range#6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().), |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | /// Writes the columns of `self` to the first 6 elements in `slice`. |
| 109 | /// |
| 110 | /// # Panics |
| 111 | /// |
| 112 | /// Panics if `slice` is less than 6 elements long. |
| 113 | #[inline] |
| 114 | pub fn write_cols_to_slicerust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]write_cols_to_slice().(self, slice: &mut [f32]) { |
| 115 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..write_cols_to_slicerust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]write_cols_to_slice().(&mut 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/range/Range#4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().); |
| 116 | self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation..write_to_slicerust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]write_to_slice().(&mut 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/range/Range#6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().); |
| 117 | } |
| 118 | |
| 119 | /// Creates an affine transform that changes scale. |
| 120 | /// Note that if any scale is zero the transform will be non-invertible. |
| 121 | #[inline] |
| 122 | #[must_use] |
| 123 | pub fn from_scalerust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_scale().(scale: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 124 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 125 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_diagonalrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_diagonal().(scale), |
| 126 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::ZEROrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]ZERO., |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | /// Creates an affine transform from the given rotation `angle`. |
| 131 | #[inline] |
| 132 | #[must_use] |
| 133 | pub fn from_anglerust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_angle().(angle: f32) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 134 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 135 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_anglerust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_angle().(angle), |
| 136 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::ZEROrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]ZERO., |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /// Creates an affine transformation from the given 2D `translation`. |
| 141 | #[inline] |
| 142 | #[must_use] |
| 143 | pub fn from_translationrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_translation().(translation: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 144 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 145 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::IDENTITYrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]IDENTITY., |
| 146 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation., |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /// Creates an affine transform from a 2x2 matrix (expressing scale, shear and rotation) |
| 151 | #[inline] |
| 152 | #[must_use] |
| 153 | pub fn from_mat2rust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_mat2().(matrix2: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 154 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 155 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2., |
| 156 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::ZEROrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]ZERO., |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | /// Creates an affine transform from a 2x2 matrix (expressing scale, shear and rotation) and a |
| 161 | /// translation vector. |
| 162 | /// |
| 163 | /// Equivalent to |
| 164 | /// `Affine2::from_translation(translation) * Affine2::from_mat2(mat2)` |
| 165 | #[inline] |
| 166 | #[must_use] |
| 167 | pub fn from_mat2_translationrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_mat2_translation().(matrix2: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#, translation: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 168 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 169 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2., |
| 170 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation., |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | /// Creates an affine transform from the given 2D `scale`, rotation `angle` (in radians) and |
| 175 | /// `translation`. |
| 176 | /// |
| 177 | /// Equivalent to `Affine2::from_translation(translation) * |
| 178 | /// Affine2::from_angle(angle) * Affine2::from_scale(scale)` |
| 179 | #[inline] |
| 180 | #[must_use] |
| 181 | pub fn from_scale_angle_translationrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_scale_angle_translation().(scale: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#, angle: f32, translation: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 182 | let rotation = Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_anglerust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_angle().(angle); |
| 183 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 184 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_colsrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols().(rotation.x_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#x_axis. rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Mul<f32>`]mul().*rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Mul<f32>`]mul(). rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Mul<f32>`]mul().scale.xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., rotation.y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis. rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Mul<f32>`]mul().*rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Mul<f32>`]mul(). rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Mul<f32>`]mul().scale.yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y.), |
| 185 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation., |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | /// Creates an affine transform from the given 2D rotation `angle` (in radians) and |
| 190 | /// `translation`. |
| 191 | /// |
| 192 | /// Equivalent to `Affine2::from_translation(translation) * Affine2::from_angle(angle)` |
| 193 | #[inline] |
| 194 | #[must_use] |
| 195 | pub fn from_angle_translationrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_angle_translation().(angle: f32, translation: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 196 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 197 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_anglerust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_angle().(angle), |
| 198 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation., |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | /// The given `Mat3` must be an affine transform, |
| 203 | #[inline] |
| 204 | #[must_use] |
| 205 | pub fn from_mat3rust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_mat3().(m: Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 206 | use craterust-analyzer cargo glam 0.25.0 crate/::swizzlesrust-analyzer cargo glam 0.25.0 swizzles/::Vec3Swizzlesrust-analyzer cargo glam 0.25.0 swizzles/vec_traits/Vec3Swizzles#; |
| 207 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 208 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_colsrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols().(m.x_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#x_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/vec3_impl/impl#[Vec3][Vec3Swizzles]xy().(), m.y_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#y_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/vec3_impl/impl#[Vec3][Vec3Swizzles]xy().()), |
| 209 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: m.z_axisrust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#z_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/vec3_impl/impl#[Vec3][Vec3Swizzles]xy().(), |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /// The given [`Mat3A`] must be an affine transform, |
| 214 | #[inline] |
| 215 | #[must_use] |
| 216 | pub fn from_mat3arust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]from_mat3a().(m: Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 217 | use craterust-analyzer cargo glam 0.25.0 crate/::swizzlesrust-analyzer cargo glam 0.25.0 swizzles/::Vec3Swizzlesrust-analyzer cargo glam 0.25.0 swizzles/vec_traits/Vec3Swizzles#; |
| 218 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 219 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: Mat2rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/Mat2#::from_colsrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]from_cols().(m.x_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#x_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]xy().(), m.y_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#y_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]xy().()), |
| 220 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: m.z_axisrust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#z_axis..xyrust-analyzer cargo glam 0.25.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]xy().(), |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | /// Extracts `scale`, `angle` and `translation` from `self`. |
| 225 | /// |
| 226 | /// The transform is expected to be non-degenerate and without shearing, or the output |
| 227 | /// will be invalid. |
| 228 | /// |
| 229 | /// # Panics |
| 230 | /// |
| 231 | /// Will panic if the determinant `self.matrix2` is zero or if the resulting scale |
| 232 | /// vector contains any zero elements when `glam_assert` is enabled. |
| 233 | #[inline] |
| 234 | #[must_use] |
| 235 | pub fn to_scale_angle_translationrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]to_scale_angle_translation().(self) -> (Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#, f32, Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) { |
| 236 | use craterust-analyzer cargo glam 0.25.0 crate/::f32rust-analyzer cargo glam 0.25.0 f32/::mathrust-analyzer cargo glam 0.25.0 f32/math/; |
| 237 | let det = self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..determinantrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]determinant().(); |
| 238 | glam_assertrust-analyzer cargo glam 0.25.0 macros/glam_assert!!(det != 0.0); |
| 239 | |
| 240 | let scale = Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#::newrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]new().( |
| 241 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..x_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#x_axis..lengthrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]length().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().mathrust-analyzer cargo glam 0.25.0 f32/math/::signumrust-analyzer cargo glam 0.25.0 f32/math/std_math/signum().(det), |
| 242 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis..lengthrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]length().(), |
| 243 | ); |
| 244 | |
| 245 | glam_assertrust-analyzer cargo glam 0.25.0 macros/glam_assert!!(scale.cmpne(Vec2::ZERO).all()); |
| 246 | |
| 247 | let angle = mathrust-analyzer cargo glam 0.25.0 f32/math/::atan2rust-analyzer cargo glam 0.25.0 f32/math/std_math/atan2().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis..xrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#x., self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis..yrust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#y.); |
| 248 | |
| 249 | (scale, angle, self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.) |
| 250 | } |
| 251 | |
| 252 | /// Transforms the given 2D point, applying shear, scale, rotation and translation. |
| 253 | #[inline] |
| 254 | #[must_use] |
| 255 | pub fn transform_point2rust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]transform_point2().(&self, rhs: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2# { |
| 256 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2. rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().rhs rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add().+rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add(). rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add().self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation. |
| 257 | } |
| 258 | |
| 259 | /// Transforms the given 2D vector, applying shear, scale and rotation (but NOT |
| 260 | /// translation). |
| 261 | /// |
| 262 | /// To also apply translation, use [`Self::transform_point2()`] instead. |
| 263 | #[inline] |
| 264 | pub fn transform_vector2rust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]transform_vector2().(&self, rhs: Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#) -> Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2# { |
| 265 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2. rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().rhs |
| 266 | } |
| 267 | |
| 268 | /// Returns `true` if, and only if, all elements are finite. |
| 269 | /// |
| 270 | /// If any element is either `NaN`, positive or negative infinity, this will return |
| 271 | /// `false`. |
| 272 | #[inline] |
| 273 | #[must_use] |
| 274 | pub fn is_finiterust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]is_finite().(&self) -> bool { |
| 275 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..is_finiterust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]is_finite().() && self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation..is_finiterust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]is_finite().() |
| 276 | } |
| 277 | |
| 278 | /// Returns `true` if any elements are `NaN`. |
| 279 | #[inline] |
| 280 | #[must_use] |
| 281 | pub fn is_nanrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]is_nan().(&self) -> bool { |
| 282 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..is_nanrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]is_nan().() || self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation..is_nanrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]is_nan().() |
| 283 | } |
| 284 | |
| 285 | /// Returns true if the absolute difference of all elements between `self` and `rhs` |
| 286 | /// is less than or equal to `max_abs_diff`. |
| 287 | /// |
| 288 | /// This can be used to compare if two 3x4 matrices contain similar elements. It works |
| 289 | /// best when comparing with a known value. The `max_abs_diff` that should be used used |
| 290 | /// depends on the values being compared against. |
| 291 | /// |
| 292 | /// For more see |
| 293 | /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/). |
| 294 | #[inline] |
| 295 | #[must_use] |
| 296 | pub fn abs_diff_eqrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]abs_diff_eq().(&self, rhs: Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2], max_abs_diff: f32) -> bool { |
| 297 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..abs_diff_eqrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]abs_diff_eq().(rhs.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2., max_abs_diff) |
| 298 | && self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation..abs_diff_eqrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]abs_diff_eq().(rhs.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation., max_abs_diff) |
| 299 | } |
| 300 | |
| 301 | /// Return the inverse of this transform. |
| 302 | /// |
| 303 | /// Note that if the transform is not invertible the result will be invalid. |
| 304 | #[inline] |
| 305 | #[must_use] |
| 306 | pub fn inverserust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]inverse().(&self) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 307 | let matrix2 = self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..inverserust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2]inverse().(); |
| 308 | // transform negative translation by the matrix inverse: |
| 309 | let translation = -rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][Neg]neg().(matrix2 rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.); |
| 310 | |
| 311 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2] { |
| 312 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2., |
| 313 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation., |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 319 | #[inline(always)] |
| 320 | fn defaultrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Default]default().() -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Default] { |
| 321 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Default]::IDENTITYrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]IDENTITY. |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | impl Derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref# for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 326 | type Targetrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Deref]Target# = craterust-analyzer cargo glam 0.25.0 crate/::derefrust-analyzer cargo glam 0.25.0 deref/::Cols3rust-analyzer cargo glam 0.25.0 deref/Cols3#<Vec2rust-analyzer cargo glam 0.25.0 f32/vec2/Vec2#>; |
| 327 | #[inline(always)] |
| 328 | fn derefrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Deref]deref().(&self) -> &Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Deref]::Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# { |
| 329 | unsafe { &*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().(self as *const Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Deref] as *const Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Deref]::Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target#) } |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | impl DerefMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/DerefMut# for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 334 | #[inline(always)] |
| 335 | fn deref_mutrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][DerefMut]deref_mut().(&mut self) -> &mut Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][DerefMut]::Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target# { |
| 336 | unsafe { &mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().(self as *mut Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][DerefMut] as *mut Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][DerefMut]::Targetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#Target#) } |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 341 | #[inline] |
| 342 | fn eqrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`PartialEq<Self>`]eq().(&self, rhs: &Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`PartialEq<Self>`]) -> bool { |
| 343 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..eqrust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`PartialEq<Self>`]eq().(&rhs.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.) && self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation..eqrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`PartialEq<Self>`]eq().(&rhs.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.) |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | #[cfg(not(target_arch = "spirv"))] |
| 348 | impl 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/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 349 | fn fmtrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Debug]fmt().(&self, fmt: &mut 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/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> 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/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 350 | 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!!(Affine2)) |
| 351 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("matrix2", &self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.) |
| 352 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("translation", &self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.) |
| 353 | .finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().() |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | #[cfg(not(target_arch = "spirv"))] |
| 358 | impl 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/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 359 | fn fmtrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][Display]fmt().(&self, f: &mut 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/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> 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/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 360 | writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!( |
| 361 | f, |
| 362 | "[{}, {}, {}]", |
| 363 | self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..x_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#x_axis., self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis., self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation. |
| 364 | ) |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | impl<'a> 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#<&'a Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Product<&'a Affine2>`]> for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 369 | fn productrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Product<&'a Affine2>`]product().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Product<&'a Affine2>`] |
| 370 | where |
| 371 | I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Product<&'a Affine2>`]>, |
| 372 | { |
| 373 | iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Product<&'a Affine2>`]::IDENTITYrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2]IDENTITY., |a, &b| a rust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Self>`]mul().*rust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Self>`]mul(). rust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Self>`]mul().b) |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul# for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 378 | type Outputrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Self>`]Output# = Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#; |
| 379 | |
| 380 | #[inline] |
| 381 | fn mulrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Self>`]mul().(self, rhs: Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 382 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Self>`] { |
| 383 | matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2.: self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2. rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Self>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Self>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Self>`]mul().rhs.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2., |
| 384 | translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation.: self.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2. rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat2/impl#[Mat2][`Mul<Vec2>`]mul().rhs.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation. rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add().+rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add(). rust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2][`Add<Self>`]add().self.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation., |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign# for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 390 | #[inline] |
| 391 | fn mul_assignrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`MulAssign<Self>`]mul_assign().(&mut self, rhs: Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#) { |
| 392 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.mulrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Self>`]mul().(rhs); |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 397 | #[inline] |
| 398 | fn fromrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3][`From<Affine2>`]from().(m: Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#) -> Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 399 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3][`From<Affine2>`]::from_colsrust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3]from_cols().( |
| 400 | m.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..x_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#x_axis..extendrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]extend().(0.0), |
| 401 | m.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis..extendrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]extend().(0.0), |
| 402 | m.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation..extendrust-analyzer cargo glam 0.25.0 f32/vec2/impl#[Vec2]extend().(1.0), |
| 403 | ) |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#> for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 408 | type Outputrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Mat3>`]Output# = Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#; |
| 409 | |
| 410 | #[inline] |
| 411 | fn mulrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Mat3>`]mul().(self, rhs: Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Mat3>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 412 | Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#::fromrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3][`From<Affine2>`]from().(self) rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul().*rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul(). rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul().rhs |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#> for Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3# { |
| 417 | type Outputrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3][`Mul<Affine2>`]Output# = Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#; |
| 418 | |
| 419 | #[inline] |
| 420 | fn mulrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3][`Mul<Affine2>`]mul().(self, rhs: Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3][`Mul<Affine2>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 421 | self rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul().*rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul(). rust-analyzer cargo glam 0.25.0 f32/mat3/impl#[Mat3][`Mul<Self>`]mul().Mat3rust-analyzer cargo glam 0.25.0 f32/mat3/Mat3#::fromrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3][`From<Affine2>`]from().(rhs) |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#> for Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A# { |
| 426 | #[inline] |
| 427 | fn fromrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3A][`From<Affine2>`]from().(m: Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#) -> Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A# { |
| 428 | Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3A][`From<Affine2>`]::from_colsrust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/impl#[Mat3A]from_cols().( |
| 429 | Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#::fromrust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/impl#[Vec3A][`From<(Vec2, f32)>`]from().((m.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..x_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#x_axis., 0.0)), |
| 430 | Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#::fromrust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/impl#[Vec3A][`From<(Vec2, f32)>`]from().((m.matrix2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#matrix2..y_axisrust-analyzer cargo glam 0.25.0 deref/Cols2#y_axis., 0.0)), |
| 431 | Vec3Arust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/Vec3A#::fromrust-analyzer cargo glam 0.25.0 f32/sse2/vec3a/impl#[Vec3A][`From<(Vec2, f32)>`]from().((m.translationrust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#translation., 1.0)), |
| 432 | ) |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#> for Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2# { |
| 437 | type Outputrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Mat3A>`]Output# = Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#; |
| 438 | |
| 439 | #[inline] |
| 440 | fn mulrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Mat3A>`]mul().(self, rhs: Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Affine2][`Mul<Mat3A>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 441 | Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#::fromrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3A][`From<Affine2>`]from().(self) rust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/impl#[Mat3A][`Mul<Self>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/impl#[Mat3A][`Mul<Self>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/impl#[Mat3A][`Mul<Self>`]mul().rhs |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#> for Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A# { |
| 446 | type Outputrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3A][`Mul<Affine2>`]Output# = Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#; |
| 447 | |
| 448 | #[inline] |
| 449 | fn mulrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3A][`Mul<Affine2>`]mul().(self, rhs: Affine2rust-analyzer cargo glam 0.25.0 f32/affine2/Affine2#) -> Selfrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3A][`Mul<Affine2>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# { |
| 450 | self rust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/impl#[Mat3A][`Mul<Self>`]mul().*rust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/impl#[Mat3A][`Mul<Self>`]mul(). rust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/impl#[Mat3A][`Mul<Self>`]mul().Mat3Arust-analyzer cargo glam 0.25.0 f32/sse2/mat3a/Mat3A#::fromrust-analyzer cargo glam 0.25.0 f32/affine2/impl#[Mat3A][`From<Affine2>`]from().(rhs) |
| 451 | } |
| 452 | } |