Debian Codegraph @

debian/missing-sources/glam-0.20.5/src/mat3.rs

raw symbols SCIP
1 use craterust-analyzer cargo glam 0.20.5 crate/::corerust-analyzer cargo glam 0.20.5 core/::{
2 storagerust-analyzer cargo glam 0.20.5 core/storage/::{Columns3rust-analyzer cargo glam 0.20.5 core/storage/Columns3#, XYZrust-analyzer cargo glam 0.20.5 core/storage/XYZ#},
3 traitsrust-analyzer cargo glam 0.20.5 core/traits/::matrixrust-analyzer cargo glam 0.20.5 core/traits/matrix/::{FloatMatrix3x3rust-analyzer cargo glam 0.20.5 core/traits/matrix/FloatMatrix3x3#, Matrix3x3rust-analyzer cargo glam 0.20.5 core/traits/matrix/Matrix3x3#, MatrixConstrust-analyzer cargo glam 0.20.5 core/traits/matrix/MatrixConst#},
4 };
5 use craterust-analyzer cargo glam 0.20.5 crate/::{DMat2rust-analyzer cargo glam 0.20.5 mat2/DMat2#, DMat4rust-analyzer cargo glam 0.20.5 mat4/DMat4#, DQuatrust-analyzer cargo glam 0.20.5 quat/DQuat#, DVec2rust-analyzer cargo glam 0.20.5 vec2/DVec2#, DVec3rust-analyzer cargo glam 0.20.5 vec3/DVec3#, EulerRotrust-analyzer cargo glam 0.20.5 euler/EulerRot#, Mat2rust-analyzer cargo glam 0.20.5 mat2/Mat2#, Mat4rust-analyzer cargo glam 0.20.5 mat4/Mat4#, Quatrust-analyzer cargo glam 0.20.5 quat/Quat#, Vec2rust-analyzer cargo glam 0.20.5 vec2/Vec2#, Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3#, Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#};
6 #[cfg(not(target_arch = "spirv"))]
7 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/;
8 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#};
9 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#, 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#, 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#};
10
11 #[cfg(all(
12 target_arch = "x86",
13 target_feature = "sse2",
14 not(feature = "scalar-math")
15 ))]
16 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core arch/::x86::*;
17 #[cfg(all(
18 target_arch = "x86_64",
19 target_feature = "sse2",
20 not(feature = "scalar-math")
21 ))]
22 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core arch/::x86_64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/arch/x86_64/::*;
23
24 #[cfg(target_feature = "simd128")]
25 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::archrust-analyzer cargo core https://github.com/rust-lang/rust/library/core arch/::wasm32::v128;
26
27 macro_rules! define_mat3_structrust-analyzer cargo glam 0.20.5 mat3/define_mat3_struct! {
28 ($mat3:ident, $inner:ident) => {
29 /// A 3x3 column major matrix.
30 ///
31 /// This 3x3 matrix type features convenience methods for creating and using linear and
32 /// affine transformations. If you are primarily dealing with 2D affine transformations the
33 /// [`Affine2`](crate::Affine2) type is much faster and more space efficient than using a
34 /// 3x3 matrix.
35 ///
36 /// Linear transformations including 3D rotation and scale can be created using methods
37 /// such as [`Self::from_diagonal()`], [`Self::from_quat()`], [`Self::from_axis_angle()`],
38 /// [`Self::from_rotation_x()`], [`Self::from_rotation_y()`], or
39 /// [`Self::from_rotation_z()`].
40 ///
41 /// The resulting matrices can be use to transform 3D vectors using regular vector
42 /// multiplication.
43 ///
44 /// Affine transformations including 2D translation, rotation and scale can be created
45 /// using methods such as [`Self::from_translation()`], [`Self::from_angle()`],
46 /// [`Self::from_scale()`] and [`Self::from_scale_angle_translation()`].
47 ///
48 /// The [`Self::transform_point2()`] and [`Self::transform_vector2()`] convenience methods
49 /// are provided for performing affine transforms on 2D vectors and points. These multiply
50 /// 2D inputs as 3D vectors with an implicit `z` value of `1` for points and `0` for
51 /// vectors respectively. These methods assume that `Self` contains a valid affine
52 /// transform.
53 #[derive(Clone, Copy)]
54 #[cfg_attr(not(target_arch = "spirv"), repr(C))]
55 pub struct $mat3(pub(crate) $inner);
56 };
57 }
58
59 macro_rules! impl_mat3_methodsrust-analyzer cargo glam 0.20.5 mat3/impl_mat3_methods! {
60 ($t:ty, $vec3:ident, $vec3a:ident, $vec2:ident, $quat:ident, $mat2:ident, $mat4:ident, $inner:ident) => {
61 /// A 3x3 matrix with all elements set to `0.0`.
62 pub const ZERO: Self = Self($inner::ZERO);
63
64 /// A 3x3 identity matrix, where all diagonal elements are `1`, and all off-diagonal
65 /// elements are `0`.
66 pub const IDENTITY: Self = Self($inner::IDENTITY);
67
68 /// All NAN:s.
69 pub const NAN: Self = Self(<$inner as crate::core::traits::scalar::NanConstEx>::NAN);
70
71 /// Creates a 3x3 matrix from three column vectors.
72 #[inline(always)]
73 pub fn from_cols(x_axis: $vec3a, y_axis: $vec3a, z_axis: $vec3a) -> Self {
74 Self(Matrix3x3::from_cols(x_axis.0, y_axis.0, z_axis.0))
75 }
76
77 /// Creates a 3x3 matrix from a `[S; 9]` array stored in column major order.
78 /// If your data is stored in row major you will need to `transpose` the returned
79 /// matrix.
80 #[inline(always)]
81 pub fn from_cols_array(m: &[$t; 9]) -> Self {
82 Self(Matrix3x3::from_cols_array(m))
83 }
84
85 /// Creates a `[S; 9]` array storing data in column major order.
86 /// If you require data in row major order `transpose` the matrix first.
87 #[inline(always)]
88 pub fn to_cols_array(&self) -> [$t; 9] {
89 self.0.to_cols_array()
90 }
91
92 /// Creates a 3x3 matrix from a `[[S; 3]; 3]` 2D array stored in column major order.
93 /// If your data is in row major order you will need to `transpose` the returned
94 /// matrix.
95 #[inline(always)]
96 pub fn from_cols_array_2d(m: &[[$t; 3]; 3]) -> Self {
97 Self(Matrix3x3::from_cols_array_2d(m))
98 }
99
100 /// Creates a `[[S; 3]; 3]` 2D array storing data in column major order.
101 /// If you require data in row major order `transpose` the matrix first.
102 #[inline(always)]
103 pub fn to_cols_array_2d(&self) -> [[$t; 3]; 3] {
104 self.0.to_cols_array_2d()
105 }
106
107 /// Creates a 3x3 matrix with its diagonal set to `diagonal` and all other entries set to 0.
108 /// The resulting matrix is a 3D scale transfom.
109 #[doc(alias = "scale")]
110 #[inline(always)]
111 pub fn from_diagonal(diagonal: $vec3) -> Self {
112 Self($inner::from_diagonal(diagonal.0))
113 }
114
115 /// Creates a 3x3 matrix from a 4x4 matrix, discarding the 3rd row and column.
116 pub fn from_mat4(m: $mat4) -> Self {
117 Self::from_cols(
118 $vec3a(m.x_axis.0.into()),
119 $vec3a(m.y_axis.0.into()),
120 $vec3a(m.z_axis.0.into()),
121 )
122 }
123
124 /// Creates a 3D rotation matrix from the given quaternion.
125 ///
126 /// # Panics
127 ///
128 /// Will panic if `rotation` is not normalized when `glam_assert` is enabled.
129 #[inline(always)]
130 pub fn from_quat(rotation: $quat) -> Self {
131 // TODO: SIMD?
132 Self($inner::from_quaternion(rotation.0.into()))
133 }
134
135 /// Creates a 3D rotation matrix from a normalized rotation `axis` and `angle` (in
136 /// radians).
137 ///
138 /// # Panics
139 ///
140 /// Will panic if `axis` is not normalized when `glam_assert` is enabled.
141 #[inline(always)]
142 pub fn from_axis_angle(axis: $vec3, angle: $t) -> Self {
143 Self(FloatMatrix3x3::from_axis_angle(axis.0, angle))
144 }
145
146 #[inline(always)]
147 /// Creates a 3D rotation matrix from the given euler rotation sequence and the angles (in
148 /// radians).
149 pub fn from_euler(order: EulerRot, a: $t, b: $t, c: $t) -> Self {
150 let quat = $quat::from_euler(order, a, b, c);
151 Self::from_quat(quat)
152 }
153
154 /// Creates a 3D rotation matrix from `angle` (in radians) around the x axis.
155 #[inline(always)]
156 pub fn from_rotation_x(angle: $t) -> Self {
157 Self($inner::from_rotation_x(angle))
158 }
159
160 /// Creates a 3D rotation matrix from `angle` (in radians) around the y axis.
161 #[inline(always)]
162 pub fn from_rotation_y(angle: $t) -> Self {
163 Self($inner::from_rotation_y(angle))
164 }
165
166 /// Creates a 3D rotation matrix from `angle` (in radians) around the z axis.
167 #[inline(always)]
168 pub fn from_rotation_z(angle: $t) -> Self {
169 Self($inner::from_rotation_z(angle))
170 }
171
172 /// Creates an affine transformation matrix from the given 2D `translation`.
173 ///
174 /// The resulting matrix can be used to transform 2D points and vectors. See
175 /// [`Self::transform_point2()`] and [`Self::transform_vector2()`].
176 #[inline(always)]
177 pub fn from_translation(translation: $vec2) -> Self {
178 Self(Matrix3x3::from_translation(translation.0))
179 }
180
181 /// Creates an affine transformation matrix from the given 2D rotation `angle` (in
182 /// radians).
183 ///
184 /// The resulting matrix can be used to transform 2D points and vectors. See
185 /// [`Self::transform_point2()`] and [`Self::transform_vector2()`].
186 #[inline(always)]
187 pub fn from_angle(angle: $t) -> Self {
188 Self(FloatMatrix3x3::from_angle(angle))
189 }
190
191 /// Creates an affine transformation matrix from the given 2D `scale`, rotation `angle` (in
192 /// radians) and `translation`.
193 ///
194 /// The resulting matrix can be used to transform 2D points and vectors. See
195 /// [`Self::transform_point2()`] and [`Self::transform_vector2()`].
196 #[inline(always)]
197 pub fn from_scale_angle_translation(scale: $vec2, angle: $t, translation: $vec2) -> Self {
198 Self(FloatMatrix3x3::from_scale_angle_translation(
199 scale.0,
200 angle,
201 translation.0,
202 ))
203 }
204
205 /// Creates an affine transformation matrix from the given non-uniform 2D `scale`.
206 ///
207 /// The resulting matrix can be used to transform 2D points and vectors. See
208 /// [`Self::transform_point2()`] and [`Self::transform_vector2()`].
209 ///
210 /// # Panics
211 ///
212 /// Will panic if all elements of `scale` are zero when `glam_assert` is enabled.
213 #[inline(always)]
214 pub fn from_scale(scale: $vec2) -> Self {
215 Self(Matrix3x3::from_scale(scale.0))
216 }
217
218 /// Creates an affine transformation matrix from the given 2x2 matrix.
219 ///
220 /// The resulting matrix can be used to transform 2D points and vectors. See
221 /// [`Self::transform_point2()`] and [`Self::transform_vector2()`].
222 #[inline(always)]
223 pub fn from_mat2(m: $mat2) -> Self {
224 Self::from_cols((m.x_axis, 0.0).into(), (m.y_axis, 0.0).into(), $vec3a::Z)
225 }
226
227 /// Creates a 3x3 matrix from the first 9 values in `slice`.
228 ///
229 /// # Panics
230 ///
231 /// Panics if `slice` is less than 9 elements long.
232 #[inline(always)]
233 pub fn from_cols_slice(slice: &[$t]) -> Self {
234 Self(Matrix3x3::from_cols_slice(slice))
235 }
236
237 /// Writes the columns of `self` to the first 9 elements in `slice`.
238 ///
239 /// # Panics
240 ///
241 /// Panics if `slice` is less than 9 elements long.
242 #[inline(always)]
243 pub fn write_cols_to_slice(self, slice: &mut [$t]) {
244 Matrix3x3::write_cols_to_slice(&self.0, slice)
245 }
246
247 /// Returns the matrix column for the given `index`.
248 ///
249 /// # Panics
250 ///
251 /// Panics if `index` is greater than 2.
252 #[inline]
253 pub fn col(&self, index: usize) -> $vec3a {
254 match index {
255 0 => self.x_axis,
256 1 => self.y_axis,
257 2 => self.z_axis,
258 _ => panic!("index out of bounds"),
259 }
260 }
261
262 /// Returns a mutable reference to the matrix column for the given `index`.
263 ///
264 /// # Panics
265 ///
266 /// Panics if `index` is greater than 2.
267 #[inline]
268 pub fn col_mut(&mut self, index: usize) -> &mut $vec3a {
269 match index {
270 0 => &mut self.x_axis,
271 1 => &mut self.y_axis,
272 2 => &mut self.z_axis,
273 _ => panic!("index out of bounds"),
274 }
275 }
276
277 /// Returns the matrix row for the given `index`.
278 ///
279 /// # Panics
280 ///
281 /// Panics if `index` is greater than 2.
282 #[inline]
283 pub fn row(&self, index: usize) -> $vec3a {
284 match index {
285 0 => $vec3a::new(self.x_axis.x, self.y_axis.x, self.z_axis.x),
286 1 => $vec3a::new(self.x_axis.y, self.y_axis.y, self.z_axis.y),
287 2 => $vec3a::new(self.x_axis.z, self.y_axis.z, self.z_axis.z),
288 _ => panic!("index out of bounds"),
289 }
290 }
291
292 /// Returns `true` if, and only if, all elements are finite.
293 /// If any element is either `NaN`, positive or negative infinity, this will return `false`.
294 #[inline]
295 pub fn is_finite(&self) -> bool {
296 self.x_axis.is_finite() && self.y_axis.is_finite() && self.z_axis.is_finite()
297 }
298
299 /// Returns `true` if any elements are `NaN`.
300 #[inline]
301 pub fn is_nan(&self) -> bool {
302 self.x_axis.is_nan() || self.y_axis.is_nan() || self.z_axis.is_nan()
303 }
304
305 /// Returns the transpose of `self`.
306 #[must_use]
307 #[inline(always)]
308 pub fn transpose(&self) -> Self {
309 Self(self.0.transpose())
310 }
311
312 /// Returns the determinant of `self`.
313 #[inline(always)]
314 pub fn determinant(&self) -> $t {
315 self.0.determinant()
316 }
317
318 /// Returns the inverse of `self`.
319 ///
320 /// If the matrix is not invertible the returned matrix will be invalid.
321 ///
322 /// # Panics
323 ///
324 /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled.
325 #[must_use]
326 #[inline(always)]
327 pub fn inverse(&self) -> Self {
328 Self(self.0.inverse())
329 }
330
331 /// Transforms a 3D vector.
332 #[inline(always)]
333 pub fn mul_vec3(&self, other: $vec3) -> $vec3 {
334 $vec3(self.0.mul_vector(other.0.into()).into())
335 }
336
337 /// Multiplies two 3x3 matrices.
338 #[inline]
339 pub fn mul_mat3(&self, other: &Self) -> Self {
340 Self(self.0.mul_matrix(&other.0))
341 }
342
343 /// Adds two 3x3 matrices.
344 #[inline(always)]
345 pub fn add_mat3(&self, other: &Self) -> Self {
346 Self(self.0.add_matrix(&other.0))
347 }
348
349 /// Subtracts two 3x3 matrices.
350 #[inline(always)]
351 pub fn sub_mat3(&self, other: &Self) -> Self {
352 Self(self.0.sub_matrix(&other.0))
353 }
354
355 /// Multiplies a 3x3 matrix by a scalar.
356 #[inline(always)]
357 pub fn mul_scalar(&self, other: $t) -> Self {
358 Self(self.0.mul_scalar(other))
359 }
360
361 /// Transforms the given 2D vector as a point.
362 ///
363 /// This is the equivalent of multiplying `other` as a 3D vector where `z` is `1`.
364 ///
365 /// This method assumes that `self` contains a valid affine transform.
366 #[inline(always)]
367 pub fn transform_point2(&self, other: $vec2) -> $vec2 {
368 $mat2::from_cols($vec2(self.x_axis.0.into()), $vec2(self.y_axis.0.into())) * other
369 + $vec2(self.z_axis.0.into())
370 }
371
372 /// Rotates the given 2D vector.
373 ///
374 /// This is the equivalent of multiplying `other` as a 3D vector where `z` is `0`.
375 ///
376 /// This method assumes that `self` contains a valid affine transform.
377 #[inline(always)]
378 pub fn transform_vector2(&self, other: $vec2) -> $vec2 {
379 $mat2::from_cols($vec2(self.x_axis.0.into()), $vec2(self.y_axis.0.into())) * other
380 }
381
382 /// Returns true if the absolute difference of all elements between `self` and `other`
383 /// is less than or equal to `max_abs_diff`.
384 ///
385 /// This can be used to compare if two matrices contain similar elements. It works best
386 /// when comparing with a known value. The `max_abs_diff` that should be used used
387 /// depends on the values being compared against.
388 ///
389 /// For more see
390 /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/).
391 #[inline(always)]
392 pub fn abs_diff_eq(&self, other: Self, max_abs_diff: $t) -> bool {
393 self.0.abs_diff_eq(&other.0, max_abs_diff)
394 }
395 };
396 }
397
398 macro_rules! impl_mat3_traitsrust-analyzer cargo glam 0.20.5 mat3/impl_mat3_traits! {
399 ($t:ty, $new:ident, $mat3:ident, $vec3:ident, $vec3a:ident) => {
400 /// Creates a 3x3 matrix from three column vectors.
401 #[inline(always)]
402 pub fn $new(x_axis: $vec3a, y_axis: $vec3a, z_axis: $vec3a) -> $mat3 {
403 $mat3::from_cols(x_axis, y_axis, z_axis)
404 }
405
406 impl_matn_common_traits!($t, $mat3, $vec3a);
407
408 impl PartialEq for $mat3 {
409 #[inline]
410 fn eq(&self, other: &Self) -> bool {
411 self.x_axis.eq(&other.x_axis)
412 && self.y_axis.eq(&other.y_axis)
413 && self.z_axis.eq(&other.z_axis)
414 }
415 }
416
417 impl Deref for $mat3 {
418 type Target = Columns3<$vec3a>;
419 #[inline(always)]
420 fn deref(&self) -> &Self::Target {
421 unsafe { &*(self as *const Self as *const Self::Target) }
422 }
423 }
424
425 impl DerefMut for $mat3 {
426 #[inline(always)]
427 fn deref_mut(&mut self) -> &mut Self::Target {
428 unsafe { &mut *(self as *mut Self as *mut Self::Target) }
429 }
430 }
431
432 #[cfg(not(target_arch = "spirv"))]
433 impl fmt::Display for $mat3 {
434 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
435 write!(f, "[{}, {}, {}]", self.x_axis, self.y_axis, self.z_axis)
436 }
437 }
438
439 #[cfg(not(target_arch = "spirv"))]
440 impl fmt::Debug for $mat3 {
441 fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
442 fmt.debug_struct("$mat3")
443 .field("x_axis", &self.x_axis)
444 .field("y_axis", &self.y_axis)
445 .field("z_axis", &self.z_axis)
446 .finish()
447 }
448 }
449 };
450 }
451
452 macro_rules! impl_mat3_traits_unsaferust-analyzer cargo glam 0.20.5 mat3/impl_mat3_traits_unsafe! {
453 ($t:ty, $mat3:ident) => {
454 #[cfg(not(target_arch = "spirv"))]
455 impl AsRef<[$t; 9]> for $mat3 {
456 #[inline(always)]
457 fn as_ref(&self) -> &[$t; 9] {
458 unsafe { &*(self as *const Self as *const [$t; 9]) }
459 }
460 }
461
462 #[cfg(not(target_arch = "spirv"))]
463 impl AsMut<[$t; 9]> for $mat3 {
464 #[inline(always)]
465 fn as_mut(&mut self) -> &mut [$t; 9] {
466 unsafe { &mut *(self as *mut Self as *mut [$t; 9]) }
467 }
468 }
469 };
470 }
471
472 type InnerF32rust-analyzer cargo glam 0.20.5 mat3/InnerF32# = Columns3rust-analyzer cargo glam 0.20.5 core/storage/Columns3#<XYZrust-analyzer cargo glam 0.20.5 core/storage/XYZ#<f32>>;
473 define_mat3_structrust-analyzer cargo glam 0.20.5 mat3/define_mat3_struct!!(Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3#, InnerF32rust-analyzer cargo glam 0.20.5 mat3/InnerF32#);
474
475 impl Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3# {
476 impl_mat3_methodsrust-analyzer cargo glam 0.20.5 mat3/impl_mat3_methods!!(f32, Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3#, Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3#, Vec2rust-analyzer cargo glam 0.20.5 vec2/Vec2#, Quatrust-analyzer cargo glam 0.20.5 quat/Quat#, Mat2rust-analyzer cargo glam 0.20.5 mat2/Mat2#, Mat4rust-analyzer cargo glam 0.20.5 mat4/Mat4#, InnerF32rust-analyzer cargo glam 0.20.5 mat3/InnerF32#);
477
478 /// Transforms a `Vec3A`.
479 #[inline]
480 pub fn mul_vec3arust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3]mul_vec3a().(&self, other: Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#) -> Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A# {
481 self.mul_vec3rust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3]mul_vec3().(other.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()
482 }
483
484 #[inline(always)]
485 pub fn as_dmat3rust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3]as_dmat3().(&self) -> DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3# {
486 DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3#::from_colsrust-analyzer cargo glam 0.20.5 mat3/impl#[DMat3]from_cols().(
487 self.x_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#x_axis..as_dvec3rust-analyzer cargo glam 0.20.5 vec3/impl#[Vec3]as_dvec3().(),
488 self.y_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#y_axis..as_dvec3rust-analyzer cargo glam 0.20.5 vec3/impl#[Vec3]as_dvec3().(),
489 self.z_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#z_axis..as_dvec3rust-analyzer cargo glam 0.20.5 vec3/impl#[Vec3]as_dvec3().(),
490 )
491 }
492 }
493 impl_mat3_traitsrust-analyzer cargo glam 0.20.5 mat3/impl_mat3_traits!!(f32, mat3rust-analyzer cargo glam 0.20.5 mat3/mat3()., Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3#, Vec3, Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3#);
494 impl_mat3_traits_unsaferust-analyzer cargo glam 0.20.5 mat3/impl_mat3_traits_unsafe!!(f32, Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3#);
495
496 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#> for Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3# {
497 type Outputrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3][`Mul<Vec3A>`]Output# = Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#;
498 #[inline(always)]
499 fn mulrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3][`Mul<Vec3A>`]mul().(self, other: Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#) -> Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A# {
500 self.mul_vec3arust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3]mul_vec3a().(other)
501 }
502 }
503
504 #[cfg(all(target_feature = "sse2", not(feature = "scalar-math")))]
505 type InnerF32Arust-analyzer cargo glam 0.20.5 mat3/InnerF32A# = Columns3rust-analyzer cargo glam 0.20.5 core/storage/Columns3#<__m128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128#>;
506
507 #[cfg(all(target_feature = "simd128", not(feature = "scalar-math")))]
508 type InnerF32A = Columns3rust-analyzer cargo glam 0.20.5 core/storage/Columns3#<v128>;
509
510 #[cfg(any(
511 not(any(target_feature = "sse2", target_feature = "simd128")),
512 feature = "scalar-math"
513 ))]
514 type InnerF32A = Columns3rust-analyzer cargo glam 0.20.5 core/storage/Columns3#<craterust-analyzer cargo glam 0.20.5 crate/::corerust-analyzer cargo glam 0.20.5 core/::storagerust-analyzer cargo glam 0.20.5 core/storage/::XYZF32A16rust-analyzer cargo glam 0.20.5 core/storage/XYZF32A16#>;
515 define_mat3_structrust-analyzer cargo glam 0.20.5 mat3/define_mat3_struct!!(Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A#, InnerF32Arust-analyzer cargo glam 0.20.5 mat3/InnerF32A#);
516
517 impl Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A# {
518 impl_mat3_methodsrust-analyzer cargo glam 0.20.5 mat3/impl_mat3_methods!!(f32, Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3#, Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#, Vec2rust-analyzer cargo glam 0.20.5 vec2/Vec2#, Quatrust-analyzer cargo glam 0.20.5 quat/Quat#, Mat2rust-analyzer cargo glam 0.20.5 mat2/Mat2#, Mat4rust-analyzer cargo glam 0.20.5 mat4/Mat4#, InnerF32Arust-analyzer cargo glam 0.20.5 mat3/InnerF32A#);
519
520 /// Transforms a `Vec3A`.
521 #[inline]
522 pub fn mul_vec3arust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3A]mul_vec3a().(&self, other: Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#) -> Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A# {
523 Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#(self.0rust-analyzer cargo glam 0.20.5 mat3/Mat3A#0..mul_vectorrust-analyzer cargo glam 0.20.5 core/traits/matrix/Matrix3x3#mul_vector().(other.0rust-analyzer cargo glam 0.20.5 vec3/Vec3A#0.))
524 }
525
526 #[inline(always)]
527 pub fn as_dmat3rust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3A]as_dmat3().(&self) -> DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3# {
528 DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3#::from_colsrust-analyzer cargo glam 0.20.5 mat3/impl#[DMat3]from_cols().(
529 self.x_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#x_axis..as_dvec3rust-analyzer cargo glam 0.20.5 vec3/impl#[Vec3A]as_dvec3().(),
530 self.y_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#y_axis..as_dvec3rust-analyzer cargo glam 0.20.5 vec3/impl#[Vec3A]as_dvec3().(),
531 self.z_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#z_axis..as_dvec3rust-analyzer cargo glam 0.20.5 vec3/impl#[Vec3A]as_dvec3().(),
532 )
533 }
534 }
535 impl_mat3_traitsrust-analyzer cargo glam 0.20.5 mat3/impl_mat3_traits!!(f32, mat3arust-analyzer cargo glam 0.20.5 mat3/mat3a()., Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A#, Vec3, Vec3Arust-analyzer cargo glam 0.20.5 vec3/Vec3A#);
536
537 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3#> for Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A# {
538 type Outputrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3A][`Mul<Vec3>`]Output# = Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3#;
539 #[inline(always)]
540 fn mulrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3A][`Mul<Vec3>`]mul().(self, other: Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3#) -> Vec3rust-analyzer cargo glam 0.20.5 vec3/Vec3# {
541 self.mul_vec3rust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3A]mul_vec3().(other)
542 }
543 }
544
545 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3#> for Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A# {
546 #[inline(always)]
547 fn fromrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3A][`From<Mat3>`]from().(m: Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3#) -> Selfrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3A][`From<Mat3>`] {
548 Selfrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3A][`From<Mat3>`](m.0rust-analyzer cargo glam 0.20.5 mat3/Mat3#0..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())
549 }
550 }
551
552 impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A#> for Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3# {
553 #[inline(always)]
554 fn fromrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3][`From<Mat3A>`]from().(m: Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A#) -> Selfrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3][`From<Mat3A>`] {
555 Selfrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3][`From<Mat3A>`](m.0rust-analyzer cargo glam 0.20.5 mat3/Mat3A#0..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())
556 }
557 }
558
559 type InnerF64rust-analyzer cargo glam 0.20.5 mat3/InnerF64# = Columns3rust-analyzer cargo glam 0.20.5 core/storage/Columns3#<XYZrust-analyzer cargo glam 0.20.5 core/storage/XYZ#<f64>>;
560 define_mat3_structrust-analyzer cargo glam 0.20.5 mat3/define_mat3_struct!!(DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3#, InnerF64rust-analyzer cargo glam 0.20.5 mat3/InnerF64#);
561
562 impl DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3# {
563 impl_mat3_methodsrust-analyzer cargo glam 0.20.5 mat3/impl_mat3_methods!!(f64, DVec3rust-analyzer cargo glam 0.20.5 vec3/DVec3#, DVec3rust-analyzer cargo glam 0.20.5 vec3/DVec3#, DVec2rust-analyzer cargo glam 0.20.5 vec2/DVec2#, DQuatrust-analyzer cargo glam 0.20.5 quat/DQuat#, DMat2rust-analyzer cargo glam 0.20.5 mat2/DMat2#, DMat4rust-analyzer cargo glam 0.20.5 mat4/DMat4#, InnerF64rust-analyzer cargo glam 0.20.5 mat3/InnerF64#);
564
565 #[inline(always)]
566 pub fn as_mat3rust-analyzer cargo glam 0.20.5 mat3/impl#[DMat3]as_mat3().(&self) -> Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3# {
567 Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3#::from_colsrust-analyzer cargo glam 0.20.5 mat3/impl#[Mat3]from_cols().(
568 self.x_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#x_axis..as_vec3rust-analyzer cargo glam 0.20.5 vec3/impl#[DVec3]as_vec3().(),
569 self.y_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#y_axis..as_vec3rust-analyzer cargo glam 0.20.5 vec3/impl#[DVec3]as_vec3().(),
570 self.z_axisrust-analyzer cargo glam 0.20.5 core/storage/Columns3#z_axis..as_vec3rust-analyzer cargo glam 0.20.5 vec3/impl#[DVec3]as_vec3().(),
571 )
572 }
573 }
574 impl_mat3_traitsrust-analyzer cargo glam 0.20.5 mat3/impl_mat3_traits!!(f64, dmat3rust-analyzer cargo glam 0.20.5 mat3/dmat3()., DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3#, DVec3, DVec3rust-analyzer cargo glam 0.20.5 vec3/DVec3#);
575 impl_mat3_traits_unsaferust-analyzer cargo glam 0.20.5 mat3/impl_mat3_traits_unsafe!!(f64, DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3#);
576
577 mod const_test_mat3rust-analyzer cargo glam 0.20.5 mat3/const_test_mat3/ {
578 const_assert_eqrust-analyzer cargo glam 0.20.5 macros/const_assert_eq!!(
579 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<f32>(),
580 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<superrust-analyzer cargo glam 0.20.5 mat3/::Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3#>()
581 );
582 const_assert_eqrust-analyzer cargo glam 0.20.5 macros/const_assert_eq!!(36, corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<superrust-analyzer cargo glam 0.20.5 mat3/::Mat3rust-analyzer cargo glam 0.20.5 mat3/Mat3#>());
583 }
584
585 mod const_test_mat3arust-analyzer cargo glam 0.20.5 mat3/const_test_mat3a/ {
586 const_assert_eqrust-analyzer cargo glam 0.20.5 macros/const_assert_eq!!(16, corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<superrust-analyzer cargo glam 0.20.5 mat3/::Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A#>());
587 const_assert_eqrust-analyzer cargo glam 0.20.5 macros/const_assert_eq!!(48, corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<superrust-analyzer cargo glam 0.20.5 mat3/::Mat3Arust-analyzer cargo glam 0.20.5 mat3/Mat3A#>());
588 }
589
590 mod const_test_dmat3rust-analyzer cargo glam 0.20.5 mat3/const_test_dmat3/ {
591 const_assert_eqrust-analyzer cargo glam 0.20.5 macros/const_assert_eq!!(
592 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<f64>(),
593 corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<superrust-analyzer cargo glam 0.20.5 mat3/::DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3#>()
594 );
595 const_assert_eqrust-analyzer cargo glam 0.20.5 macros/const_assert_eq!!(72, corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<superrust-analyzer cargo glam 0.20.5 mat3/::DMat3rust-analyzer cargo glam 0.20.5 mat3/DMat3#>());
596 }