Debian Codegraph @

debian/missing-sources/glam-0.23.0/src/f32/sse2/mat4.rs

raw symbols SCIP
1 // Generated from mat.rs.tera template. Edit the template, not the generated file.
2
3 use craterust-analyzer cargo glam 0.23.0 crate/::{sse2rust-analyzer cargo glam 0.23.0 sse2/::*, swizzlesrust-analyzer cargo glam 0.23.0 swizzles/::*, DMat4rust-analyzer cargo glam 0.23.0 f64/dmat4/DMat4#, EulerRotrust-analyzer cargo glam 0.23.0 euler/EulerRot#, Mat3rust-analyzer cargo glam 0.23.0 f32/mat3/Mat3#, Mat3Arust-analyzer cargo glam 0.23.0 f32/sse2/mat3a/Mat3A#, Quatrust-analyzer cargo glam 0.23.0 f32/sse2/quat/Quat#, Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, Vec3Arust-analyzer cargo glam 0.23.0 f32/sse2/vec3a/Vec3A#, Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#};
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 #[cfg(target_arch = "x86")]
10 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::*;
11 #[cfg(target_arch = "x86_64")]
12 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/::*;
13
14 #[cfg(feature = "libm")]
15 #[allow(unused_imports)]
16 use num_traits::Float;
17
18 /// Creates a 4x4 matrix from column vectors.
19 #[inline(always)]
20 pub const fn mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/mat4().(x_axis: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#, y_axis: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#, z_axis: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#, w_axis: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#) -> Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
21 Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(x_axis, y_axis, z_axis, w_axis)
22 }
23
24 /// A 4x4 column major matrix.
25 ///
26 /// This 4x4 matrix type features convenience methods for creating and using affine transforms and
27 /// perspective projections. If you are primarily dealing with 3D affine transformations
28 /// considering using [`Affine3A`](crate::Affine3A) which is faster than a 4x4 matrix
29 /// for some affine operations.
30 ///
31 /// Affine transformations including 3D translation, rotation and scale can be created
32 /// using methods such as [`Self::from_translation()`], [`Self::from_quat()`],
33 /// [`Self::from_scale()`] and [`Self::from_scale_rotation_translation()`].
34 ///
35 /// Othographic projections can be created using the methods [`Self::orthographic_lh()`] for
36 /// left-handed coordinate systems and [`Self::orthographic_rh()`] for right-handed
37 /// systems. The resulting matrix is also an affine transformation.
38 ///
39 /// The [`Self::transform_point3()`] and [`Self::transform_vector3()`] convenience methods
40 /// are provided for performing affine transformations on 3D vectors and points. These
41 /// multiply 3D inputs as 4D vectors with an implicit `w` value of `1` for points and `0`
42 /// for vectors respectively. These methods assume that `Self` contains a valid affine
43 /// transform.
44 ///
45 /// Perspective projections can be created using methods such as
46 /// [`Self::perspective_lh()`], [`Self::perspective_infinite_lh()`] and
47 /// [`Self::perspective_infinite_reverse_lh()`] for left-handed co-ordinate systems and
48 /// [`Self::perspective_rh()`], [`Self::perspective_infinite_rh()`] and
49 /// [`Self::perspective_infinite_reverse_rh()`] for right-handed co-ordinate systems.
50 ///
51 /// The resulting perspective project can be use to transform 3D vectors as points with
52 /// perspective correction using the [`Self::project_point3()`] convenience method.
53 #[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:)]
54 #[repr(C)]
55 pub struct Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
56 pub x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#,
57 pub y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#,
58 pub z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#,
59 pub w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#,
60 }
61
62 impl Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
63 /// A 4x4 matrix with all elements set to `0.0`.
64 pub const ZEROrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]ZERO.: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::ZEROrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]ZERO., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::ZEROrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]ZERO., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::ZEROrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]ZERO., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::ZEROrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]ZERO.);
65
66 /// A 4x4 identity matrix, where all diagonal elements are `1`, and all off-diagonal elements are `0`.
67 pub const IDENTITYrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]IDENTITY.: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Xrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]X., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Yrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]Y., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Zrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]Z., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.);
68
69 /// All NAN:s.
70 pub const NANrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]NAN.: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::NANrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]NAN., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::NANrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]NAN., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::NANrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]NAN., Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::NANrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]NAN.);
71
72 #[allow(clippy::too_many_arguments)]
73 #[inline(always)]
74 const fn newrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]new().(
75 m00: f32,
76 m01: f32,
77 m02: f32,
78 m03: f32,
79 m10: f32,
80 m11: f32,
81 m12: f32,
82 m13: f32,
83 m20: f32,
84 m21: f32,
85 m22: f32,
86 m23: f32,
87 m30: f32,
88 m31: f32,
89 m32: f32,
90 m33: f32,
91 ) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
92 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
93 x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(m00, m01, m02, m03),
94 y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(m10, m11, m12, m13),
95 z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(m20, m21, m22, m23),
96 w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(m30, m31, m32, m33),
97 }
98 }
99
100 /// Creates a 4x4 matrix from two column vectors.
101 #[inline(always)]
102 pub const fn from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(x_axis: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#, y_axis: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#, z_axis: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#, w_axis: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
103 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
104 x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.,
105 y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.,
106 z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.,
107 w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.,
108 }
109 }
110
111 /// Creates a 4x4 matrix from a `[f32; 16]` array stored in column major order.
112 /// If your data is stored in row major you will need to `transpose` the returned
113 /// matrix.
114 #[inline]
115 pub const fn from_cols_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols_array().(m: &[f32; 16]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
116 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::newrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]new().(
117 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()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().9]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().10]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().11]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().12]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().13]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
118 m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().14]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().15]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
119 )
120 }
121
122 /// Creates a `[f32; 16]` array storing data in column major order.
123 /// If you require data in row major order `transpose` the matrix first.
124 #[inline]
125 pub const fn to_cols_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]to_cols_array().(&self) -> [f32; 16] {
126 let [x_axis_x, x_axis_y, x_axis_z, x_axis_w] = self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().();
127 let [y_axis_x, y_axis_y, y_axis_z, y_axis_w] = self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().();
128 let [z_axis_x, z_axis_y, z_axis_z, z_axis_w] = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().();
129 let [w_axis_x, w_axis_y, w_axis_z, w_axis_w] = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().();
130
131 [
132 x_axis_x, x_axis_y, x_axis_z, x_axis_w, y_axis_x, y_axis_y, y_axis_z, y_axis_w,
133 z_axis_x, z_axis_y, z_axis_z, z_axis_w, w_axis_x, w_axis_y, w_axis_z, w_axis_w,
134 ]
135 }
136
137 /// Creates a 4x4 matrix from a `[[f32; 4]; 4]` 4D array stored in column major order.
138 /// If your data is in row major order you will need to `transpose` the returned
139 /// matrix.
140 #[inline]
141 pub const fn from_cols_array_2drust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols_array_2d().(m: &[[f32; 4]; 4]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
142 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
143 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::from_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]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().),
144 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::from_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]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().),
145 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::from_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]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().),
146 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::from_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]from_array().(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().),
147 )
148 }
149
150 /// Creates a `[[f32; 4]; 4]` 4D array storing data in column major order.
151 /// If you require data in row major order `transpose` the matrix first.
152 #[inline]
153 pub const fn to_cols_array_2drust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]to_cols_array_2d().(&self) -> [[f32; 4]; 4] {
154 [
155 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().(),
156 self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().(),
157 self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().(),
158 self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().(),
159 ]
160 }
161
162 /// Creates a 4x4 matrix with its diagonal set to `diagonal` and all other entries set to 0.
163 #[doc(alias = "scale")]
164 #[inline]
165 pub const fn from_diagonalrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_diagonal().(diagonal: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
166 // diagonal.x, diagonal.y etc can't be done in a const-context
167 let [x, y, z, w] = diagonal.to_arrayrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]to_array().();
168 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::newrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]new().(
169 x, 0.0, 0.0, 0.0, 0.0, y, 0.0, 0.0, 0.0, 0.0, z, 0.0, 0.0, 0.0, 0.0, w,
170 )
171 }
172
173 #[inline]
174 fn quat_to_axesrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]quat_to_axes().(rotation: Quatrust-analyzer cargo glam 0.23.0 f32/sse2/quat/Quat#) -> (Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#, Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#, Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#) {
175 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(rotation.is_normalized());
176
177 let (x, y, z, w) = rotation.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().();
178 let x2 = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().x;
179 let y2 = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().y;
180 let z2 = z rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().z;
181 let xx = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().x2;
182 let xy = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().y2;
183 let xz = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z2;
184 let yy = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().y2;
185 let yz = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z2;
186 let zz = z rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z2;
187 let wx = w rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().x2;
188 let wy = w rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().y2;
189 let wz = w rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z2;
190
191 let x_axis = Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().(yy rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().zz), xy rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().wz, xz rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().wy, 0.0);
192 let y_axis = Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(xy rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().wz, 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().(xx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().zz), yz rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().wx, 0.0);
193 let z_axis = Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(xz rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().wy, yz rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().wx, 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().(xx rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().yy), 0.0);
194 (x_axis, y_axis, z_axis)
195 }
196
197 /// Creates an affine transformation matrix from the given 3D `scale`, `rotation` and
198 /// `translation`.
199 ///
200 /// The resulting matrix can be used to transform 3D points and vectors. See
201 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
202 ///
203 /// # Panics
204 ///
205 /// Will panic if `rotation` is not normalized when `glam_assert` is enabled.
206 #[inline]
207 pub fn from_scale_rotation_translationrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_scale_rotation_translation().(scale: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, rotation: Quatrust-analyzer cargo glam 0.23.0 f32/sse2/quat/Quat#, translation: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
208 let (x_axis, y_axis, z_axis) = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::quat_to_axesrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]quat_to_axes().(rotation);
209 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
210 x_axis.mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(scale.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x.),
211 y_axis.mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(scale.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y.),
212 z_axis.mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(scale.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z.),
213 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::fromrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`From<(Vec3, f32)>`]from().((translation, 1.0)),
214 )
215 }
216
217 /// Creates an affine transformation matrix from the given 3D `translation`.
218 ///
219 /// The resulting matrix can be used to transform 3D points and vectors. See
220 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
221 ///
222 /// # Panics
223 ///
224 /// Will panic if `rotation` is not normalized when `glam_assert` is enabled.
225 #[inline]
226 pub fn from_rotation_translationrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_rotation_translation().(rotation: Quatrust-analyzer cargo glam 0.23.0 f32/sse2/quat/Quat#, translation: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
227 let (x_axis, y_axis, z_axis) = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::quat_to_axesrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]quat_to_axes().(rotation);
228 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(x_axis, y_axis, z_axis, Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::fromrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`From<(Vec3, f32)>`]from().((translation, 1.0)))
229 }
230
231 /// Extracts `scale`, `rotation` and `translation` from `self`. The input matrix is
232 /// expected to be a 3D affine transformation matrix otherwise the output will be invalid.
233 ///
234 /// # Panics
235 ///
236 /// Will panic if the determinant of `self` is zero or if the resulting scale vector
237 /// contains any zero elements when `glam_assert` is enabled.
238 #[inline]
239 pub fn to_scale_rotation_translationrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]to_scale_rotation_translation().(&self) -> (Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, Quatrust-analyzer cargo glam 0.23.0 f32/sse2/quat/Quat#, Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) {
240 let det = self.determinantrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]determinant().();
241 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(det != 0.0);
242
243 let scale = Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#::newrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]new().(
244 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..lengthrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]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().det.signumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]signum().(),
245 self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..lengthrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]length().(),
246 self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..lengthrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]length().(),
247 );
248
249 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(scale.cmpne(Vec3::ZERO).all());
250
251 let inv_scale = scale.reciprust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]recip().();
252
253 let rotation = Quatrust-analyzer cargo glam 0.23.0 f32/sse2/quat/Quat#::from_rotation_axesrust-analyzer cargo glam 0.23.0 f32/sse2/quat/impl#[Quat]from_rotation_axes().(
254 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(inv_scale.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x.).xyzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().(),
255 self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(inv_scale.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y.).xyzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().(),
256 self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(inv_scale.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z.).xyzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().(),
257 );
258
259 let translation = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..xyzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().();
260
261 (scale, rotation, translation)
262 }
263
264 /// Creates an affine transformation matrix from the given `rotation` quaternion.
265 ///
266 /// The resulting matrix can be used to transform 3D points and vectors. See
267 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
268 ///
269 /// # Panics
270 ///
271 /// Will panic if `rotation` is not normalized when `glam_assert` is enabled.
272 #[inline]
273 pub fn from_quatrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_quat().(rotation: Quatrust-analyzer cargo glam 0.23.0 f32/sse2/quat/Quat#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
274 let (x_axis, y_axis, z_axis) = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::quat_to_axesrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]quat_to_axes().(rotation);
275 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(x_axis, y_axis, z_axis, Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.)
276 }
277
278 /// Creates an affine transformation matrix from the given 3x3 linear transformation
279 /// matrix.
280 ///
281 /// The resulting matrix can be used to transform 3D points and vectors. See
282 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
283 #[inline]
284 pub fn from_mat3rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_mat3().(m: Mat3rust-analyzer cargo glam 0.23.0 f32/mat3/Mat3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
285 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
286 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::fromrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`From<(Vec3, f32)>`]from().((m.x_axisrust-analyzer cargo glam 0.23.0 f32/mat3/Mat3#x_axis., 0.0)),
287 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::fromrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`From<(Vec3, f32)>`]from().((m.y_axisrust-analyzer cargo glam 0.23.0 f32/mat3/Mat3#y_axis., 0.0)),
288 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::fromrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`From<(Vec3, f32)>`]from().((m.z_axisrust-analyzer cargo glam 0.23.0 f32/mat3/Mat3#z_axis., 0.0)),
289 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.,
290 )
291 }
292
293 /// Creates an affine transformation matrix from the given 3x3 linear transformation
294 /// matrix.
295 ///
296 /// The resulting matrix can be used to transform 3D points and vectors. See
297 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
298 #[inline]
299 pub fn from_mat3arust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_mat3a().(m: Mat3Arust-analyzer cargo glam 0.23.0 f32/sse2/mat3a/Mat3A#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
300 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
301 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::fromrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`From<(Vec3A, f32)>`]from().((m.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat3a/Mat3A#x_axis., 0.0)),
302 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::fromrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`From<(Vec3A, f32)>`]from().((m.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat3a/Mat3A#y_axis., 0.0)),
303 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::fromrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`From<(Vec3A, f32)>`]from().((m.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat3a/Mat3A#z_axis., 0.0)),
304 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.,
305 )
306 }
307
308 /// Creates an affine transformation matrix from the given 3D `translation`.
309 ///
310 /// The resulting matrix can be used to transform 3D points and vectors. See
311 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
312 #[inline]
313 pub fn from_translationrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_translation().(translation: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
314 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
315 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Xrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]X.,
316 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Yrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]Y.,
317 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Zrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]Z.,
318 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(translation.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x., translation.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y., translation.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z., 1.0),
319 )
320 }
321
322 /// Creates an affine transformation matrix containing a 3D rotation around a normalized
323 /// rotation `axis` of `angle` (in radians).
324 ///
325 /// The resulting matrix can be used to transform 3D points and vectors. See
326 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
327 ///
328 /// # Panics
329 ///
330 /// Will panic if `axis` is not normalized when `glam_assert` is enabled.
331 #[inline]
332 pub fn from_axis_anglerust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_axis_angle().(axis: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, angle: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
333 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(axis.is_normalized());
334
335 let (sin, cos) = angle.sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sin_cos().();
336 let axis_sin = axis.mulrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3][`Mul<f32>`]mul().(sin);
337 let axis_sq = axis.mulrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3][`Mul<Self>`]mul().(axis);
338 let omc = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().cos;
339 let xyomc = axis.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().axis.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc;
340 let xzomc = axis.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().axis.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc;
341 let yzomc = axis.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().axis.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc;
342 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
343 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(
344 axis_sq.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().cos,
345 xyomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().axis_sin.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z.,
346 xzomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().axis_sin.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y.,
347 0.0,
348 ),
349 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(
350 xyomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().axis_sin.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z.,
351 axis_sq.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().cos,
352 yzomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().axis_sin.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x.,
353 0.0,
354 ),
355 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(
356 xzomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().axis_sin.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y.,
357 yzomc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().axis_sin.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x.,
358 axis_sq.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().omc rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().cos,
359 0.0,
360 ),
361 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.,
362 )
363 }
364
365 #[inline]
366 /// Creates a affine transformation matrix containing a rotation from the given euler
367 /// rotation sequence and angles (in radians).
368 ///
369 /// The resulting matrix can be used to transform 3D points and vectors. See
370 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
371 pub fn from_eulerrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_euler().(order: EulerRotrust-analyzer cargo glam 0.23.0 euler/EulerRot#, a: f32, b: f32, c: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
372 let quat = Quatrust-analyzer cargo glam 0.23.0 f32/sse2/quat/Quat#::from_eulerrust-analyzer cargo glam 0.23.0 f32/sse2/quat/impl#[Quat]from_euler().(order, a, b, c);
373 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_quatrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_quat().(quat)
374 }
375
376 /// Creates an affine transformation matrix containing a 3D rotation around the x axis of
377 /// `angle` (in radians).
378 ///
379 /// The resulting matrix can be used to transform 3D points and vectors. See
380 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
381 #[inline]
382 pub fn from_rotation_xrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_rotation_x().(angle: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
383 let (sina, cosa) = angle.sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sin_cos().();
384 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
385 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Xrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]X.,
386 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, cosa, sina, 0.0),
387 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().sina, cosa, 0.0),
388 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.,
389 )
390 }
391
392 /// Creates an affine transformation matrix containing a 3D rotation around the y axis of
393 /// `angle` (in radians).
394 ///
395 /// The resulting matrix can be used to transform 3D points and vectors. See
396 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
397 #[inline]
398 pub fn from_rotation_yrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_rotation_y().(angle: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
399 let (sina, cosa) = angle.sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sin_cos().();
400 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
401 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(cosa, 0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().sina, 0.0),
402 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Yrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]Y.,
403 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(sina, 0.0, cosa, 0.0),
404 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.,
405 )
406 }
407
408 /// Creates an affine transformation matrix containing a 3D rotation around the z axis of
409 /// `angle` (in radians).
410 ///
411 /// The resulting matrix can be used to transform 3D points and vectors. See
412 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
413 #[inline]
414 pub fn from_rotation_zrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_rotation_z().(angle: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
415 let (sina, cosa) = angle.sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sin_cos().();
416 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
417 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(cosa, sina, 0.0, 0.0),
418 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().sina, cosa, 0.0, 0.0),
419 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Zrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]Z.,
420 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.,
421 )
422 }
423
424 /// Creates an affine transformation matrix containing the given 3D non-uniform `scale`.
425 ///
426 /// The resulting matrix can be used to transform 3D points and vectors. See
427 /// [`Self::transform_point3()`] and [`Self::transform_vector3()`].
428 ///
429 /// # Panics
430 ///
431 /// Will panic if all elements of `scale` are zero when `glam_assert` is enabled.
432 #[inline]
433 pub fn from_scalerust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_scale().(scale: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
434 // Do not panic as long as any component is non-zero
435 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(scale.cmpne(Vec3::ZERO).any());
436
437 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
438 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(scale.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x., 0.0, 0.0, 0.0),
439 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, scale.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y., 0.0, 0.0),
440 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, scale.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z., 0.0),
441 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::Wrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]W.,
442 )
443 }
444
445 /// Creates a 4x4 matrix from the first 16 values in `slice`.
446 ///
447 /// # Panics
448 ///
449 /// Panics if `slice` is less than 16 elements long.
450 #[inline]
451 pub const fn from_cols_slicerust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols_slice().(slice: &[f32]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
452 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::newrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]new().(
453 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().,
454 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()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().9]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().10]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().11]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().12]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().13]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().14]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().15]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
455 )
456 }
457
458 /// Writes the columns of `self` to the first 16 elements in `slice`.
459 ///
460 /// # Panics
461 ///
462 /// Panics if `slice` is less than 16 elements long.
463 #[inline]
464 pub fn write_cols_to_slicerust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]write_cols_to_slice().(self, slice: &mut [f32]) {
465 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.23.0 f32/sse2/mat4/Mat4#x_axis..xrust-analyzer cargo glam 0.23.0 deref/Vec4#x.;
466 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.23.0 f32/sse2/mat4/Mat4#x_axis..yrust-analyzer cargo glam 0.23.0 deref/Vec4#y.;
467 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.23.0 f32/sse2/mat4/Mat4#x_axis..zrust-analyzer cargo glam 0.23.0 deref/Vec4#z.;
468 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.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..wrust-analyzer cargo glam 0.23.0 deref/Vec4#w.;
469 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.23.0 f32/sse2/mat4/Mat4#y_axis..xrust-analyzer cargo glam 0.23.0 deref/Vec4#x.;
470 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.23.0 f32/sse2/mat4/Mat4#y_axis..yrust-analyzer cargo glam 0.23.0 deref/Vec4#y.;
471 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.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..zrust-analyzer cargo glam 0.23.0 deref/Vec4#z.;
472 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.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..wrust-analyzer cargo glam 0.23.0 deref/Vec4#w.;
473 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.23.0 f32/sse2/mat4/Mat4#z_axis..xrust-analyzer cargo glam 0.23.0 deref/Vec4#x.;
474 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().9]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..yrust-analyzer cargo glam 0.23.0 deref/Vec4#y.;
475 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().10]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..zrust-analyzer cargo glam 0.23.0 deref/Vec4#z.;
476 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().11]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..wrust-analyzer cargo glam 0.23.0 deref/Vec4#w.;
477 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().12]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..xrust-analyzer cargo glam 0.23.0 deref/Vec4#x.;
478 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().13]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..yrust-analyzer cargo glam 0.23.0 deref/Vec4#y.;
479 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().14]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..zrust-analyzer cargo glam 0.23.0 deref/Vec4#z.;
480 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().15]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..wrust-analyzer cargo glam 0.23.0 deref/Vec4#w.;
481 }
482
483 /// Returns the matrix column for the given `index`.
484 ///
485 /// # Panics
486 ///
487 /// Panics if `index` is greater than 3.
488 #[inline]
489 pub fn colrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]col().(&self, index: usize) -> Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4# {
490 match index {
491 0 => self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.,
492 1 => self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.,
493 2 => self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.,
494 3 => self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.,
495 _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"),
496 }
497 }
498
499 /// Returns a mutable reference to the matrix column for the given `index`.
500 ///
501 /// # Panics
502 ///
503 /// Panics if `index` is greater than 3.
504 #[inline]
505 pub fn col_mutrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]col_mut().(&mut self, index: usize) -> &mut Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4# {
506 match index {
507 0 => &mut self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.,
508 1 => &mut self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.,
509 2 => &mut self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.,
510 3 => &mut self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.,
511 _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"),
512 }
513 }
514
515 /// Returns the matrix row for the given `index`.
516 ///
517 /// # Panics
518 ///
519 /// Panics if `index` is greater than 3.
520 #[inline]
521 pub fn rowrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]row().(&self, index: usize) -> Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4# {
522 match index {
523 0 => Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..xrust-analyzer cargo glam 0.23.0 deref/Vec4#x., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..xrust-analyzer cargo glam 0.23.0 deref/Vec4#x., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..xrust-analyzer cargo glam 0.23.0 deref/Vec4#x., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..xrust-analyzer cargo glam 0.23.0 deref/Vec4#x.),
524 1 => Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..yrust-analyzer cargo glam 0.23.0 deref/Vec4#y., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..yrust-analyzer cargo glam 0.23.0 deref/Vec4#y., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..yrust-analyzer cargo glam 0.23.0 deref/Vec4#y., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..yrust-analyzer cargo glam 0.23.0 deref/Vec4#y.),
525 2 => Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..zrust-analyzer cargo glam 0.23.0 deref/Vec4#z., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..zrust-analyzer cargo glam 0.23.0 deref/Vec4#z., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..zrust-analyzer cargo glam 0.23.0 deref/Vec4#z., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..zrust-analyzer cargo glam 0.23.0 deref/Vec4#z.),
526 3 => Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..wrust-analyzer cargo glam 0.23.0 deref/Vec4#w., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..wrust-analyzer cargo glam 0.23.0 deref/Vec4#w., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..wrust-analyzer cargo glam 0.23.0 deref/Vec4#w., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..wrust-analyzer cargo glam 0.23.0 deref/Vec4#w.),
527 _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"),
528 }
529 }
530
531 /// Returns `true` if, and only if, all elements are finite.
532 /// If any element is either `NaN`, positive or negative infinity, this will return `false`.
533 #[inline]
534 pub fn is_finiterust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]is_finite().(&self) -> bool {
535 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..is_finiterust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]is_finite().()
536 && self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..is_finiterust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]is_finite().()
537 && self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..is_finiterust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]is_finite().()
538 && self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..is_finiterust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]is_finite().()
539 }
540
541 /// Returns `true` if any elements are `NaN`.
542 #[inline]
543 pub fn is_nanrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]is_nan().(&self) -> bool {
544 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..is_nanrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]is_nan().() || self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..is_nanrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]is_nan().() || self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..is_nanrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]is_nan().() || self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..is_nanrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]is_nan().()
545 }
546
547 /// Returns the transpose of `self`.
548 #[must_use]
549 #[inline]
550 pub fn transposerust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]transpose().(&self) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
551 unsafe {
552 // Based on https://github.com/microsoft/DirectXMath `XMMatrixTranspose`
553 let tmp0 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_00_01_00);
554 let tmp1 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_10_11_10);
555 let tmp2 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_00_01_00);
556 let tmp3 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_10_11_10);
557
558 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
559 x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#(_mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(tmp0, tmp2, 0b10_00_10_00)),
560 y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#(_mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(tmp0, tmp2, 0b11_01_11_01)),
561 z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#(_mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(tmp1, tmp3, 0b10_00_10_00)),
562 w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#(_mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(tmp1, tmp3, 0b11_01_11_01)),
563 }
564 }
565 }
566
567 /// Returns the determinant of `self`.
568 pub fn determinantrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]determinant().(&self) -> f32 {
569 unsafe {
570 // Based on https://github.com/g-truc/glm `glm_mat4_determinant_lowp`
571 let swp2a = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_01_01_10);
572 let swp3a = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_10_11_11);
573 let swp2b = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_10_11_11);
574 let swp3b = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_01_01_10);
575 let swp2c = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_01_10);
576 let swp3c = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_10_00_00);
577
578 let mula = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp2a, swp3a);
579 let mulb = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp2b, swp3b);
580 let mulc = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp2c, swp3c);
581 let sube = _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mula, mulb);
582 let subf = _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(_mm_movehl_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_movehl_ps().(mulc, mulc), mulc);
583
584 let subfaca = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(sube, sube, 0b10_01_00_00);
585 let swpfaca = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_00_01);
586 let mulfaca = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swpfaca, subfaca);
587
588 let subtmpb = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(sube, subf, 0b00_00_11_01);
589 let subfacb = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(subtmpb, subtmpb, 0b11_01_01_00);
590 let swpfacb = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_01_10_10);
591 let mulfacb = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swpfacb, subfacb);
592
593 let subres = _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mulfaca, mulfacb);
594 let subtmpc = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(sube, subf, 0b01_00_10_10);
595 let subfacc = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(subtmpc, subtmpc, 0b11_11_10_00);
596 let swpfacc = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b10_11_11_11);
597 let mulfacc = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swpfacc, subfacc);
598
599 let addres = _mm_add_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_add_ps().(subres, mulfacc);
600 let detcof = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(addres, _mm_setr_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_setr_ps().(1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, 1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0));
601
602 dot4rust-analyzer cargo glam 0.23.0 sse2/dot4().(self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., detcof)
603 }
604 }
605
606 /// Returns the inverse of `self`.
607 ///
608 /// If the matrix is not invertible the returned matrix will be invalid.
609 ///
610 /// # Panics
611 ///
612 /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled.
613 #[must_use]
614 pub fn inverserust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]inverse().(&self) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
615 unsafe {
616 // Based on https://github.com/g-truc/glm `glm_mat4_inverse`
617 let fac0 = {
618 let swp0a = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_11_11_11);
619 let swp0b = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b10_10_10_10);
620
621 let swp00 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b10_10_10_10);
622 let swp01 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0a, swp0a, 0b10_00_00_00);
623 let swp02 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0b, swp0b, 0b10_00_00_00);
624 let swp03 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_11_11_11);
625
626 let mul00 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp00, swp01);
627 let mul01 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp02, swp03);
628 _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul00, mul01)
629 };
630 let fac1 = {
631 let swp0a = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_11_11_11);
632 let swp0b = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_01_01_01);
633
634 let swp00 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_01_01_01);
635 let swp01 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0a, swp0a, 0b10_00_00_00);
636 let swp02 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0b, swp0b, 0b10_00_00_00);
637 let swp03 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_11_11_11);
638
639 let mul00 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp00, swp01);
640 let mul01 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp02, swp03);
641 _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul00, mul01)
642 };
643 let fac2 = {
644 let swp0a = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b10_10_10_10);
645 let swp0b = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_01_01_01);
646
647 let swp00 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_01_01_01);
648 let swp01 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0a, swp0a, 0b10_00_00_00);
649 let swp02 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0b, swp0b, 0b10_00_00_00);
650 let swp03 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b10_10_10_10);
651
652 let mul00 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp00, swp01);
653 let mul01 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp02, swp03);
654 _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul00, mul01)
655 };
656 let fac3 = {
657 let swp0a = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_11_11_11);
658 let swp0b = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_00_00);
659
660 let swp00 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_00_00);
661 let swp01 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0a, swp0a, 0b10_00_00_00);
662 let swp02 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0b, swp0b, 0b10_00_00_00);
663 let swp03 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_11_11_11);
664
665 let mul00 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp00, swp01);
666 let mul01 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp02, swp03);
667 _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul00, mul01)
668 };
669 let fac4 = {
670 let swp0a = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b10_10_10_10);
671 let swp0b = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_00_00);
672
673 let swp00 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_00_00);
674 let swp01 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0a, swp0a, 0b10_00_00_00);
675 let swp02 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0b, swp0b, 0b10_00_00_00);
676 let swp03 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b10_10_10_10);
677
678 let mul00 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp00, swp01);
679 let mul01 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp02, swp03);
680 _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul00, mul01)
681 };
682 let fac5 = {
683 let swp0a = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_01_01_01);
684 let swp0b = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_00_00);
685
686 let swp00 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_00_00);
687 let swp01 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0a, swp0a, 0b10_00_00_00);
688 let swp02 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(swp0b, swp0b, 0b10_00_00_00);
689 let swp03 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_01_01_01);
690
691 let mul00 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp00, swp01);
692 let mul01 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(swp02, swp03);
693 _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul00, mul01)
694 };
695 let sign_a = _mm_set_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_set_ps().(1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, 1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0);
696 let sign_b = _mm_set_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_set_ps().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, 1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, 1.0);
697
698 let temp0 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b00_00_00_00);
699 let vec0 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(temp0, temp0, 0b10_10_10_00);
700
701 let temp1 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b01_01_01_01);
702 let vec1 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(temp1, temp1, 0b10_10_10_00);
703
704 let temp2 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b10_10_10_10);
705 let vec2 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(temp2, temp2, 0b10_10_10_00);
706
707 let temp3 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., 0b11_11_11_11);
708 let vec3 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(temp3, temp3, 0b10_10_10_00);
709
710 let mul00 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec1, fac0);
711 let mul01 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec2, fac1);
712 let mul02 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec3, fac2);
713 let sub00 = _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul00, mul01);
714 let add00 = _mm_add_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_add_ps().(sub00, mul02);
715 let inv0 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(sign_b, add00);
716
717 let mul03 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec0, fac0);
718 let mul04 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec2, fac3);
719 let mul05 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec3, fac4);
720 let sub01 = _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul03, mul04);
721 let add01 = _mm_add_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_add_ps().(sub01, mul05);
722 let inv1 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(sign_a, add01);
723
724 let mul06 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec0, fac1);
725 let mul07 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec1, fac3);
726 let mul08 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec3, fac5);
727 let sub02 = _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul06, mul07);
728 let add02 = _mm_add_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_add_ps().(sub02, mul08);
729 let inv2 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(sign_b, add02);
730
731 let mul09 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec0, fac2);
732 let mul10 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec1, fac4);
733 let mul11 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(vec2, fac5);
734 let sub03 = _mm_sub_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_sub_ps().(mul09, mul10);
735 let add03 = _mm_add_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_add_ps().(sub03, mul11);
736 let inv3 = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(sign_a, add03);
737
738 let row0 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(inv0, inv1, 0b00_00_00_00);
739 let row1 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(inv2, inv3, 0b00_00_00_00);
740 let row2 = _mm_shuffle_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_shuffle_ps().(row0, row1, 0b10_00_10_00);
741
742 let dot0 = dot4rust-analyzer cargo glam 0.23.0 sse2/dot4().(self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..0rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#0., row2);
743 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(dot0 != 0.0);
744
745 let rcp0 = _mm_set1_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_set1_ps().(dot0.reciprust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]recip().());
746
747 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
748 x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#(_mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(inv0, rcp0)),
749 y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#(_mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(inv1, rcp0)),
750 z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#(_mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(inv2, rcp0)),
751 w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#(_mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(inv3, rcp0)),
752 }
753 }
754 }
755
756 /// Creates a left-handed view matrix using a camera position, an up direction, and a facing
757 /// direction.
758 ///
759 /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`.
760 #[inline]
761 pub fn look_to_lhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]look_to_lh().(eye: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, dir: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, up: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
762 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::look_to_rhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]look_to_rh().(eye, -rust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3][Neg]neg().dir, up)
763 }
764
765 /// Creates a right-handed view matrix using a camera position, an up direction, and a facing
766 /// direction.
767 ///
768 /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`.
769 #[inline]
770 pub fn look_to_rhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]look_to_rh().(eye: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, dir: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, up: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
771 let f = dir.normalizerust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]normalize().();
772 let s = f.crossrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]cross().(up).normalizerust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]normalize().();
773 let u = s.crossrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]cross().(f);
774
775 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
776 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(s.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x., u.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x., -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().f.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x., 0.0),
777 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(s.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y., u.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y., -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().f.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y., 0.0),
778 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(s.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z., u.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z., -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().f.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z., 0.0),
779 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().eye.dotrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]dot().(s), -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().eye.dotrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]dot().(u), eye.dotrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3]dot().(f), 1.0),
780 )
781 }
782
783 /// Creates a left-handed view matrix using a camera position, an up direction, and a focal
784 /// point.
785 /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=forward`.
786 ///
787 /// # Panics
788 ///
789 /// Will panic if `up` is not normalized when `glam_assert` is enabled.
790 #[inline]
791 pub fn look_at_lhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]look_at_lh().(eye: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, center: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, up: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
792 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(up.is_normalized());
793 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::look_to_lhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]look_to_lh().(eye, center.subrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3][`Sub<Self>`]sub().(eye), up)
794 }
795
796 /// Creates a right-handed view matrix using a camera position, an up direction, and a focal
797 /// point.
798 /// For a view coordinate system with `+X=right`, `+Y=up` and `+Z=back`.
799 ///
800 /// # Panics
801 ///
802 /// Will panic if `up` is not normalized when `glam_assert` is enabled.
803 #[inline]
804 pub fn look_at_rhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]look_at_rh().(eye: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, center: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#, up: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
805 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(up.is_normalized());
806 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::look_to_rhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]look_to_rh().(eye, center.subrust-analyzer cargo glam 0.23.0 f32/vec3/impl#[Vec3][`Sub<Self>`]sub().(eye), up)
807 }
808
809 /// Creates a right-handed perspective projection matrix with [-1,1] depth range.
810 /// This is the same as the OpenGL `gluPerspective` function.
811 /// See <https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml>
812 #[inline]
813 pub fn perspective_rh_glrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]perspective_rh_gl().(
814 fov_y_radians: f32,
815 aspect_ratio: f32,
816 z_near: f32,
817 z_far: f32,
818 ) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
819 let inv_length = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(z_near rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().z_far);
820 let f = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(0.5 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().fov_y_radians).tanrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]tan().();
821 let a = f rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().aspect_ratio;
822 let b = (z_near rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().z_far) 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().inv_length;
823 let c = (2.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z_near rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z_far) 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().inv_length;
824 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
825 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(a, 0.0, 0.0, 0.0),
826 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, f, 0.0, 0.0),
827 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, b, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0),
828 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, c, 0.0),
829 )
830 }
831
832 /// Creates a left-handed perspective projection matrix with `[0,1]` depth range.
833 ///
834 /// # Panics
835 ///
836 /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is
837 /// enabled.
838 #[inline]
839 pub fn perspective_lhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]perspective_lh().(fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
840 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(z_near > 0.0 && z_far > 0.0);
841 let (sin_fov, cos_fov) = (0.5 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().fov_y_radians).sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sin_cos().();
842 let h = cos_fov rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().sin_fov;
843 let w = h rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().aspect_ratio;
844 let r = z_far rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(z_far rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().z_near);
845 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
846 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(w, 0.0, 0.0, 0.0),
847 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, h, 0.0, 0.0),
848 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, r, 1.0),
849 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().r rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z_near, 0.0),
850 )
851 }
852
853 /// Creates a right-handed perspective projection matrix with `[0,1]` depth range.
854 ///
855 /// # Panics
856 ///
857 /// Will panic if `z_near` or `z_far` are less than or equal to zero when `glam_assert` is
858 /// enabled.
859 #[inline]
860 pub fn perspective_rhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]perspective_rh().(fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
861 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(z_near > 0.0 && z_far > 0.0);
862 let (sin_fov, cos_fov) = (0.5 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().fov_y_radians).sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sin_cos().();
863 let h = cos_fov rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().sin_fov;
864 let w = h rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().aspect_ratio;
865 let r = z_far rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(z_near rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().z_far);
866 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
867 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(w, 0.0, 0.0, 0.0),
868 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, h, 0.0, 0.0),
869 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, r, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0),
870 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, r rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().z_near, 0.0),
871 )
872 }
873
874 /// Creates an infinite left-handed perspective projection matrix with `[0,1]` depth range.
875 ///
876 /// # Panics
877 ///
878 /// Will panic if `z_near` is less than or equal to zero when `glam_assert` is enabled.
879 #[inline]
880 pub fn perspective_infinite_lhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]perspective_infinite_lh().(fov_y_radians: f32, aspect_ratio: f32, z_near: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
881 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(z_near > 0.0);
882 let (sin_fov, cos_fov) = (0.5 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().fov_y_radians).sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sin_cos().();
883 let h = cos_fov rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().sin_fov;
884 let w = h rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().aspect_ratio;
885 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
886 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(w, 0.0, 0.0, 0.0),
887 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, h, 0.0, 0.0),
888 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, 1.0, 1.0),
889 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().z_near, 0.0),
890 )
891 }
892
893 /// Creates an infinite left-handed perspective projection matrix with `[0,1]` depth range.
894 ///
895 /// # Panics
896 ///
897 /// Will panic if `z_near` is less than or equal to zero when `glam_assert` is enabled.
898 #[inline]
899 pub fn perspective_infinite_reverse_lhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]perspective_infinite_reverse_lh().(
900 fov_y_radians: f32,
901 aspect_ratio: f32,
902 z_near: f32,
903 ) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
904 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(z_near > 0.0);
905 let (sin_fov, cos_fov) = (0.5 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().fov_y_radians).sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]sin_cos().();
906 let h = cos_fov rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().sin_fov;
907 let w = h rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().aspect_ratio;
908 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
909 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(w, 0.0, 0.0, 0.0),
910 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, h, 0.0, 0.0),
911 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, 0.0, 1.0),
912 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, z_near, 0.0),
913 )
914 }
915
916 /// Creates an infinite right-handed perspective projection matrix with
917 /// `[0,1]` depth range.
918 #[inline]
919 pub fn perspective_infinite_rhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]perspective_infinite_rh().(fov_y_radians: f32, aspect_ratio: f32, z_near: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
920 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(z_near > 0.0);
921 let f = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(0.5 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().fov_y_radians).tanrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]tan().();
922 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
923 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(f rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().aspect_ratio, 0.0, 0.0, 0.0),
924 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, f, 0.0, 0.0),
925 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0),
926 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().z_near, 0.0),
927 )
928 }
929
930 /// Creates an infinite reverse right-handed perspective projection matrix
931 /// with `[0,1]` depth range.
932 #[inline]
933 pub fn perspective_infinite_reverse_rhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]perspective_infinite_reverse_rh().(
934 fov_y_radians: f32,
935 aspect_ratio: f32,
936 z_near: f32,
937 ) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
938 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(z_near > 0.0);
939 let f = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(0.5 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().fov_y_radians).tanrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]tan().();
940 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
941 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(f rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().aspect_ratio, 0.0, 0.0, 0.0),
942 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, f, 0.0, 0.0),
943 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, 0.0, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().1.0),
944 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, z_near, 0.0),
945 )
946 }
947
948 /// Creates a right-handed orthographic projection matrix with `[-1,1]` depth
949 /// range. This is the same as the OpenGL `glOrtho` function in OpenGL.
950 /// See
951 /// <https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glOrtho.xml>
952 #[inline]
953 pub fn orthographic_rh_glrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]orthographic_rh_gl().(
954 left: f32,
955 right: f32,
956 bottom: f32,
957 top: f32,
958 near: f32,
959 far: f32,
960 ) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
961 let a = 2.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().left);
962 let b = 2.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(top rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().bottom);
963 let c = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().2.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(far rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().near);
964 let tx = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().(right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().left) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().left);
965 let ty = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().(top rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().bottom) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(top rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().bottom);
966 let tz = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().(far rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().near) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(far rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().near);
967
968 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
969 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(a, 0.0, 0.0, 0.0),
970 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, b, 0.0, 0.0),
971 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, c, 0.0),
972 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(tx, ty, tz, 1.0),
973 )
974 }
975
976 /// Creates a left-handed orthographic projection matrix with `[0,1]` depth range.
977 #[inline]
978 pub fn orthographic_lhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]orthographic_lh().(
979 left: f32,
980 right: f32,
981 bottom: f32,
982 top: f32,
983 near: f32,
984 far: f32,
985 ) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
986 let rcp_width = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().left);
987 let rcp_height = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(top rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().bottom);
988 let r = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(far rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().near);
989 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
990 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(rcp_width rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().rcp_width, 0.0, 0.0, 0.0),
991 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, rcp_height rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().rcp_height, 0.0, 0.0),
992 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, r, 0.0),
993 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(
994 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().(left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().right) 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().rcp_width,
995 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().(top rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().bottom) 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().rcp_height,
996 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().r 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().near,
997 1.0,
998 ),
999 )
1000 }
1001
1002 /// Creates a right-handed orthographic projection matrix with `[0,1]` depth range.
1003 #[inline]
1004 pub fn orthographic_rhrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]orthographic_rh().(
1005 left: f32,
1006 right: f32,
1007 bottom: f32,
1008 top: f32,
1009 near: f32,
1010 far: f32,
1011 ) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
1012 let rcp_width = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(right rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().left);
1013 let rcp_height = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(top rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().bottom);
1014 let r = 1.0 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(near rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().far);
1015 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
1016 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(rcp_width rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().rcp_width, 0.0, 0.0, 0.0),
1017 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, rcp_height rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().rcp_height, 0.0, 0.0),
1018 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(0.0, 0.0, r, 0.0),
1019 Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#::newrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]new().(
1020 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().(left rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().right) 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().rcp_width,
1021 -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][Neg]neg().(top rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Add<Self>`]add().bottom) 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().rcp_height,
1022 r 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().near,
1023 1.0,
1024 ),
1025 )
1026 }
1027
1028 /// Transforms the given 3D vector as a point, applying perspective correction.
1029 ///
1030 /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is `1.0`.
1031 /// The perspective divide is performed meaning the resulting 3D vector is divided by `w`.
1032 ///
1033 /// This method assumes that `self` contains a projective transform.
1034 #[inline]
1035 pub fn project_point3rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]project_point3().(&self, rhs: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3# {
1036 let mut res = self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x.);
1037 res = self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y.).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1038 res = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z.).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1039 res = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1040 res = res.mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(res.wwwwrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]wwww().().reciprust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]recip().());
1041 res.xyzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().()
1042 }
1043
1044 /// Transforms the given 3D vector as a point.
1045 ///
1046 /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is
1047 /// `1.0`.
1048 ///
1049 /// This method assumes that `self` contains a valid affine transform. It does not perform
1050 /// a persective divide, if `self` contains a perspective transform, or if you are unsure,
1051 /// the [`Self::project_point3()`] method should be used instead.
1052 ///
1053 /// # Panics
1054 ///
1055 /// Will panic if the 3rd row of `self` is not `(0, 0, 0, 1)` when `glam_assert` is enabled.
1056 #[inline]
1057 pub fn transform_point3rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]transform_point3().(&self, rhs: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3# {
1058 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(self.row(3).abs_diff_eq(Vec4::W, 1e-6));
1059 let mut res = self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x.);
1060 res = self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y.).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1061 res = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z.).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1062 res = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1063 res.xyzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().()
1064 }
1065
1066 /// Transforms the give 3D vector as a direction.
1067 ///
1068 /// This is the equivalent of multiplying the 3D vector as a 4D vector where `w` is
1069 /// `0.0`.
1070 ///
1071 /// This method assumes that `self` contains a valid affine transform.
1072 ///
1073 /// # Panics
1074 ///
1075 /// Will panic if the 3rd row of `self` is not `(0, 0, 0, 1)` when `glam_assert` is enabled.
1076 #[inline]
1077 pub fn transform_vector3rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]transform_vector3().(&self, rhs: Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#) -> Vec3rust-analyzer cargo glam 0.23.0 f32/vec3/Vec3# {
1078 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(self.row(3).abs_diff_eq(Vec4::W, 1e-6));
1079 let mut res = self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.xrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#x.);
1080 res = self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.yrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#y.).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1081 res = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs.zrust-analyzer cargo glam 0.23.0 f32/vec3/Vec3#z.).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1082 res.xyzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xyz().()
1083 }
1084
1085 /// Transforms the given `Vec3A` as 3D point.
1086 ///
1087 /// This is the equivalent of multiplying the `Vec3A` as a 4D vector where `w` is `1.0`.
1088 #[inline]
1089 pub fn transform_point3arust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]transform_point3a().(&self, rhs: Vec3Arust-analyzer cargo glam 0.23.0 f32/sse2/vec3a/Vec3A#) -> Vec3Arust-analyzer cargo glam 0.23.0 f32/sse2/vec3a/Vec3A# {
1090 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(self.row(3).abs_diff_eq(Vec4::W, 1e-6));
1091 let mut res = self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.xxxxrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]xxxx().());
1092 res = self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.yyyyrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]yyyy().()).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1093 res = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.zzzzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]zzzz().()).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1094 res = self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1095 res.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()
1096 }
1097
1098 /// Transforms the give `Vec3A` as 3D vector.
1099 ///
1100 /// This is the equivalent of multiplying the `Vec3A` as a 4D vector where `w` is `0.0`.
1101 #[inline]
1102 pub fn transform_vector3arust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]transform_vector3a().(&self, rhs: Vec3Arust-analyzer cargo glam 0.23.0 f32/sse2/vec3a/Vec3A#) -> Vec3Arust-analyzer cargo glam 0.23.0 f32/sse2/vec3a/Vec3A# {
1103 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(self.row(3).abs_diff_eq(Vec4::W, 1e-6));
1104 let mut res = self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.xxxxrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]xxxx().());
1105 res = self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.yyyyrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]yyyy().()).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1106 res = self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.zzzzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec3a_impl/impl#[Vec3A][Vec3Swizzles]zzzz().()).addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(res);
1107 res.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()
1108 }
1109
1110 /// Transforms a 4D vector.
1111 #[inline]
1112 pub fn mul_vec4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]mul_vec4().(&self, rhs: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#) -> Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4# {
1113 let mut res = self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.xxxxrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]xxxx().());
1114 res = res.addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.yyyyrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]yyyy().()));
1115 res = res.addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.zzzzrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]zzzz().()));
1116 res = res.addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<Self>`]mul().(rhs.wwwwrust-analyzer cargo glam 0.23.0 swizzles/sse2/vec4_impl/impl#[Vec4][Vec4Swizzles]wwww().()));
1117 res
1118 }
1119
1120 /// Multiplies two 4x4 matrices.
1121 #[inline]
1122 pub fn mul_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]mul_mat4().(&self, rhs: &Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
1123 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
1124 self.mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Vec4>`]mul().(rhs.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.),
1125 self.mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Vec4>`]mul().(rhs.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.),
1126 self.mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Vec4>`]mul().(rhs.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.),
1127 self.mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Vec4>`]mul().(rhs.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.),
1128 )
1129 }
1130
1131 /// Adds two 4x4 matrices.
1132 #[inline]
1133 pub fn add_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]add_mat4().(&self, rhs: &Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
1134 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
1135 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(rhs.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.),
1136 self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(rhs.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.),
1137 self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(rhs.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.),
1138 self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..addrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Add<Self>`]add().(rhs.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.),
1139 )
1140 }
1141
1142 /// Subtracts two 4x4 matrices.
1143 #[inline]
1144 pub fn sub_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]sub_mat4().(&self, rhs: &Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
1145 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
1146 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..subrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Sub<Self>`]sub().(rhs.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.),
1147 self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..subrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Sub<Self>`]sub().(rhs.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.),
1148 self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..subrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Sub<Self>`]sub().(rhs.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.),
1149 self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..subrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Sub<Self>`]sub().(rhs.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.),
1150 )
1151 }
1152
1153 /// Multiplies a 4x4 matrix by a scalar.
1154 #[inline]
1155 pub fn mul_scalarrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]mul_scalar().(&self, rhs: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4] {
1156 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
1157 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs),
1158 self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs),
1159 self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs),
1160 self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..mulrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`Mul<f32>`]mul().(rhs),
1161 )
1162 }
1163
1164 /// Returns true if the absolute difference of all elements between `self` and `rhs`
1165 /// is less than or equal to `max_abs_diff`.
1166 ///
1167 /// This can be used to compare if two matrices contain similar elements. It works best
1168 /// when comparing with a known value. The `max_abs_diff` that should be used used
1169 /// depends on the values being compared against.
1170 ///
1171 /// For more see
1172 /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/).
1173 #[inline]
1174 pub fn abs_diff_eqrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]abs_diff_eq().(&self, rhs: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4], max_abs_diff: f32) -> bool {
1175 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..abs_diff_eqrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]abs_diff_eq().(rhs.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis., max_abs_diff)
1176 && self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..abs_diff_eqrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]abs_diff_eq().(rhs.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis., max_abs_diff)
1177 && self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..abs_diff_eqrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]abs_diff_eq().(rhs.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis., max_abs_diff)
1178 && self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..abs_diff_eqrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]abs_diff_eq().(rhs.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis., max_abs_diff)
1179 }
1180
1181 #[inline]
1182 pub fn as_dmat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]as_dmat4().(&self) -> DMat4rust-analyzer cargo glam 0.23.0 f64/dmat4/DMat4# {
1183 DMat4rust-analyzer cargo glam 0.23.0 f64/dmat4/DMat4#::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat4/impl#[DMat4]from_cols().(
1184 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..as_dvec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]as_dvec4().(),
1185 self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..as_dvec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]as_dvec4().(),
1186 self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..as_dvec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]as_dvec4().(),
1187 self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..as_dvec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4]as_dvec4().(),
1188 )
1189 }
1190 }
1191
1192 impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1193 #[inline]
1194 fn defaultrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][Default]default().() -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][Default] {
1195 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][Default]::IDENTITYrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]IDENTITY.
1196 }
1197 }
1198
1199 impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1200 type Outputrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Add<Self>`]Output# = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Add<Self>`];
1201 #[inline]
1202 fn addrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Add<Self>`]add().(self, rhs: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Add<Self>`]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Add<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output# {
1203 self.add_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]add_mat4().(&rhs)
1204 }
1205 }
1206
1207 impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#<Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1208 #[inline]
1209 fn add_assignrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`AddAssign<Self>`]add_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`AddAssign<Self>`]) {
1210 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.add_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]add_mat4().(&rhs);
1211 }
1212 }
1213
1214 impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1215 type Outputrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sub<Self>`]Output# = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sub<Self>`];
1216 #[inline]
1217 fn subrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sub<Self>`]sub().(self, rhs: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sub<Self>`]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sub<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output# {
1218 self.sub_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]sub_mat4().(&rhs)
1219 }
1220 }
1221
1222 impl SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#<Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1223 #[inline]
1224 fn sub_assignrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`SubAssign<Self>`]sub_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`SubAssign<Self>`]) {
1225 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.sub_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]sub_mat4().(&rhs);
1226 }
1227 }
1228
1229 impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1230 type Outputrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][Neg]Output# = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][Neg];
1231 #[inline]
1232 fn negrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][Neg]neg().(self) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][Neg]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#Output# {
1233 Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][Neg]::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]from_cols().(
1234 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..negrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][Neg]neg().(),
1235 self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..negrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][Neg]neg().(),
1236 self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..negrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][Neg]neg().(),
1237 self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..negrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][Neg]neg().(),
1238 )
1239 }
1240 }
1241
1242 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1243 type Outputrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Self>`]Output# = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Self>`];
1244 #[inline]
1245 fn mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Self>`]mul().(self, rhs: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Self>`]) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
1246 self.mul_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]mul_mat4().(&rhs)
1247 }
1248 }
1249
1250 impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1251 #[inline]
1252 fn mul_assignrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`MulAssign<Self>`]mul_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`MulAssign<Self>`]) {
1253 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.mul_mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]mul_mat4().(&rhs);
1254 }
1255 }
1256
1257 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1258 type Outputrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Vec4>`]Output# = Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#;
1259 #[inline]
1260 fn mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Vec4>`]mul().(self, rhs: Vec4rust-analyzer cargo glam 0.23.0 f32/sse2/vec4/Vec4#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Vec4>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
1261 self.mul_vec4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]mul_vec4().(rhs)
1262 }
1263 }
1264
1265 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#> for f32 {
1266 type Outputrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[f32][`Mul<Mat4>`]Output# = Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#;
1267 #[inline]
1268 fn mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[f32][`Mul<Mat4>`]mul().(self, rhs: Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[f32][`Mul<Mat4>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
1269 rhs.mul_scalarrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]mul_scalar().(self)
1270 }
1271 }
1272
1273 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<f32> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1274 type Outputrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<f32>`]Output# = Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<f32>`];
1275 #[inline]
1276 fn mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<f32>`]mul().(self, rhs: f32) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<f32>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
1277 self.mul_scalarrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]mul_scalar().(rhs)
1278 }
1279 }
1280
1281 impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<f32> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1282 #[inline]
1283 fn mul_assignrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`MulAssign<f32>`]mul_assign().(&mut self, rhs: f32) {
1284 *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.23.0 f32/sse2/mat4/impl#[Mat4]mul_scalar().(rhs);
1285 }
1286 }
1287
1288 impl Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#<Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<Self>`]> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1289 fn sumrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<Self>`]sum().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<Self>`]
1290 where
1291 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.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<Self>`]>,
1292 {
1293 iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<Self>`]::ZEROrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]ZERO., Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<Self>`]::addrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Add<Self>`]add().)
1294 }
1295 }
1296
1297 impl<'a> Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#<&'a Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<&'a Mat4>`]> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1298 fn sumrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<&'a Mat4>`]sum().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<&'a Mat4>`]
1299 where
1300 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.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<&'a Mat4>`]>,
1301 {
1302 iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<&'a Mat4>`]::ZEROrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]ZERO., |a, &b| Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Sum<&'a Mat4>`]::addrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Add<Self>`]add().(a, b))
1303 }
1304 }
1305
1306 impl Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product# for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1307 fn productrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<Self>`]product().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<Self>`]
1308 where
1309 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.23.0 f32/sse2/mat4/impl#[Mat4][`Product<Self>`]>,
1310 {
1311 iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<Self>`]::IDENTITYrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]IDENTITY., Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<Self>`]::mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Self>`]mul().)
1312 }
1313 }
1314
1315 impl<'a> Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product#<&'a Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<&'a Mat4>`]> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1316 fn productrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<&'a Mat4>`]product().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<&'a Mat4>`]
1317 where
1318 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.23.0 f32/sse2/mat4/impl#[Mat4][`Product<&'a Mat4>`]>,
1319 {
1320 iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<&'a Mat4>`]::IDENTITYrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4]IDENTITY., |a, &b| Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Product<&'a Mat4>`]::mulrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`Mul<Self>`]mul().(a, b))
1321 }
1322 }
1323
1324 impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1325 #[inline]
1326 fn eqrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`PartialEq<Self>`]eq().(&self, rhs: &Selfrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`PartialEq<Self>`]) -> bool {
1327 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis..eqrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`PartialEq<Self>`]eq().(&rhs.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis.)
1328 && self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis..eqrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`PartialEq<Self>`]eq().(&rhs.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis.)
1329 && self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis..eqrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`PartialEq<Self>`]eq().(&rhs.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis.)
1330 && self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis..eqrust-analyzer cargo glam 0.23.0 f32/sse2/vec4/impl#[Vec4][`PartialEq<Self>`]eq().(&rhs.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.)
1331 }
1332 }
1333
1334 #[cfg(not(target_arch = "spirv"))]
1335 impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<[f32; 16]> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1336 #[inline]
1337 fn as_refrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`AsRef<[f32; 16]>`]as_ref().(&self) -> &[f32; 16] {
1338 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.23.0 f32/sse2/mat4/impl#[Mat4][`AsRef<[f32; 16]>`] as *const [f32; 16]) }
1339 }
1340 }
1341
1342 #[cfg(not(target_arch = "spirv"))]
1343 impl AsMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsMut#<[f32; 16]> for Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1344 #[inline]
1345 fn as_mutrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][`AsMut<[f32; 16]>`]as_mut().(&mut self) -> &mut [f32; 16] {
1346 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.23.0 f32/sse2/mat4/impl#[Mat4][`AsMut<[f32; 16]>`] as *mut [f32; 16]) }
1347 }
1348 }
1349
1350 #[cfg(not(target_arch = "spirv"))]
1351 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 Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1352 fn fmtrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][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# {
1353 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!!(Mat4))
1354 .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.23.0 f32/sse2/mat4/Mat4#x_axis.)
1355 .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.23.0 f32/sse2/mat4/Mat4#y_axis.)
1356 .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.23.0 f32/sse2/mat4/Mat4#z_axis.)
1357 .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("w_axis", &self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.)
1358 .finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().()
1359 }
1360 }
1361
1362 #[cfg(not(target_arch = "spirv"))]
1363 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 Mat4rust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4# {
1364 fn fmtrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/impl#[Mat4][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# {
1365 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(
1366 f,
1367 "[{}, {}, {}, {}]",
1368 self.x_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#x_axis., self.y_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#y_axis., self.z_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#z_axis., self.w_axisrust-analyzer cargo glam 0.23.0 f32/sse2/mat4/Mat4#w_axis.
1369 )
1370 }
1371 }