A game about forced loneliness, made by TACStudios
1//------------------------------------------------------------------------------
2// <auto-generated>
3// This code was generated by a tool.
4//
5// Changes to this file may cause incorrect behavior and will be lost if
6// the code is regenerated. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
7// </auto-generated>
8//------------------------------------------------------------------------------
9using System;
10using System.Runtime.CompilerServices;
11using Unity.IL2CPP.CompilerServices;
12
13#pragma warning disable 0660, 0661
14
15namespace Unity.Mathematics
16{
17 /// <summary>A 3x4 matrix of floats.</summary>
18 [System.Serializable]
19 [Il2CppEagerStaticClassConstruction]
20 public partial struct float3x4 : System.IEquatable<float3x4>, IFormattable
21 {
22 /// <summary>Column 0 of the matrix.</summary>
23 public float3 c0;
24 /// <summary>Column 1 of the matrix.</summary>
25 public float3 c1;
26 /// <summary>Column 2 of the matrix.</summary>
27 public float3 c2;
28 /// <summary>Column 3 of the matrix.</summary>
29 public float3 c3;
30
31 /// <summary>float3x4 zero value.</summary>
32 public static readonly float3x4 zero;
33
34 /// <summary>Constructs a float3x4 matrix from four float3 vectors.</summary>
35 /// <param name="c0">The matrix column c0 will be set to this value.</param>
36 /// <param name="c1">The matrix column c1 will be set to this value.</param>
37 /// <param name="c2">The matrix column c2 will be set to this value.</param>
38 /// <param name="c3">The matrix column c3 will be set to this value.</param>
39 [MethodImpl(MethodImplOptions.AggressiveInlining)]
40 public float3x4(float3 c0, float3 c1, float3 c2, float3 c3)
41 {
42 this.c0 = c0;
43 this.c1 = c1;
44 this.c2 = c2;
45 this.c3 = c3;
46 }
47
48 /// <summary>Constructs a float3x4 matrix from 12 float values given in row-major order.</summary>
49 /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
50 /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
51 /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
52 /// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
53 /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
54 /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
55 /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
56 /// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
57 /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
58 /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
59 /// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
60 /// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
61 [MethodImpl(MethodImplOptions.AggressiveInlining)]
62 public float3x4(float m00, float m01, float m02, float m03,
63 float m10, float m11, float m12, float m13,
64 float m20, float m21, float m22, float m23)
65 {
66 this.c0 = new float3(m00, m10, m20);
67 this.c1 = new float3(m01, m11, m21);
68 this.c2 = new float3(m02, m12, m22);
69 this.c3 = new float3(m03, m13, m23);
70 }
71
72 /// <summary>Constructs a float3x4 matrix from a single float value by assigning it to every component.</summary>
73 /// <param name="v">float to convert to float3x4</param>
74 [MethodImpl(MethodImplOptions.AggressiveInlining)]
75 public float3x4(float v)
76 {
77 this.c0 = v;
78 this.c1 = v;
79 this.c2 = v;
80 this.c3 = v;
81 }
82
83 /// <summary>Constructs a float3x4 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
84 /// <param name="v">bool to convert to float3x4</param>
85 [MethodImpl(MethodImplOptions.AggressiveInlining)]
86 public float3x4(bool v)
87 {
88 this.c0 = math.select(new float3(0.0f), new float3(1.0f), v);
89 this.c1 = math.select(new float3(0.0f), new float3(1.0f), v);
90 this.c2 = math.select(new float3(0.0f), new float3(1.0f), v);
91 this.c3 = math.select(new float3(0.0f), new float3(1.0f), v);
92 }
93
94 /// <summary>Constructs a float3x4 matrix from a bool3x4 matrix by componentwise conversion.</summary>
95 /// <param name="v">bool3x4 to convert to float3x4</param>
96 [MethodImpl(MethodImplOptions.AggressiveInlining)]
97 public float3x4(bool3x4 v)
98 {
99 this.c0 = math.select(new float3(0.0f), new float3(1.0f), v.c0);
100 this.c1 = math.select(new float3(0.0f), new float3(1.0f), v.c1);
101 this.c2 = math.select(new float3(0.0f), new float3(1.0f), v.c2);
102 this.c3 = math.select(new float3(0.0f), new float3(1.0f), v.c3);
103 }
104
105 /// <summary>Constructs a float3x4 matrix from a single int value by converting it to float and assigning it to every component.</summary>
106 /// <param name="v">int to convert to float3x4</param>
107 [MethodImpl(MethodImplOptions.AggressiveInlining)]
108 public float3x4(int v)
109 {
110 this.c0 = v;
111 this.c1 = v;
112 this.c2 = v;
113 this.c3 = v;
114 }
115
116 /// <summary>Constructs a float3x4 matrix from a int3x4 matrix by componentwise conversion.</summary>
117 /// <param name="v">int3x4 to convert to float3x4</param>
118 [MethodImpl(MethodImplOptions.AggressiveInlining)]
119 public float3x4(int3x4 v)
120 {
121 this.c0 = v.c0;
122 this.c1 = v.c1;
123 this.c2 = v.c2;
124 this.c3 = v.c3;
125 }
126
127 /// <summary>Constructs a float3x4 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
128 /// <param name="v">uint to convert to float3x4</param>
129 [MethodImpl(MethodImplOptions.AggressiveInlining)]
130 public float3x4(uint v)
131 {
132 this.c0 = v;
133 this.c1 = v;
134 this.c2 = v;
135 this.c3 = v;
136 }
137
138 /// <summary>Constructs a float3x4 matrix from a uint3x4 matrix by componentwise conversion.</summary>
139 /// <param name="v">uint3x4 to convert to float3x4</param>
140 [MethodImpl(MethodImplOptions.AggressiveInlining)]
141 public float3x4(uint3x4 v)
142 {
143 this.c0 = v.c0;
144 this.c1 = v.c1;
145 this.c2 = v.c2;
146 this.c3 = v.c3;
147 }
148
149 /// <summary>Constructs a float3x4 matrix from a single double value by converting it to float and assigning it to every component.</summary>
150 /// <param name="v">double to convert to float3x4</param>
151 [MethodImpl(MethodImplOptions.AggressiveInlining)]
152 public float3x4(double v)
153 {
154 this.c0 = (float3)v;
155 this.c1 = (float3)v;
156 this.c2 = (float3)v;
157 this.c3 = (float3)v;
158 }
159
160 /// <summary>Constructs a float3x4 matrix from a double3x4 matrix by componentwise conversion.</summary>
161 /// <param name="v">double3x4 to convert to float3x4</param>
162 [MethodImpl(MethodImplOptions.AggressiveInlining)]
163 public float3x4(double3x4 v)
164 {
165 this.c0 = (float3)v.c0;
166 this.c1 = (float3)v.c1;
167 this.c2 = (float3)v.c2;
168 this.c3 = (float3)v.c3;
169 }
170
171
172 /// <summary>Implicitly converts a single float value to a float3x4 matrix by assigning it to every component.</summary>
173 /// <param name="v">float to convert to float3x4</param>
174 /// <returns>Converted value.</returns>
175 [MethodImpl(MethodImplOptions.AggressiveInlining)]
176 public static implicit operator float3x4(float v) { return new float3x4(v); }
177
178 /// <summary>Explicitly converts a single bool value to a float3x4 matrix by converting it to float and assigning it to every component.</summary>
179 /// <param name="v">bool to convert to float3x4</param>
180 /// <returns>Converted value.</returns>
181 [MethodImpl(MethodImplOptions.AggressiveInlining)]
182 public static explicit operator float3x4(bool v) { return new float3x4(v); }
183
184 /// <summary>Explicitly converts a bool3x4 matrix to a float3x4 matrix by componentwise conversion.</summary>
185 /// <param name="v">bool3x4 to convert to float3x4</param>
186 /// <returns>Converted value.</returns>
187 [MethodImpl(MethodImplOptions.AggressiveInlining)]
188 public static explicit operator float3x4(bool3x4 v) { return new float3x4(v); }
189
190 /// <summary>Implicitly converts a single int value to a float3x4 matrix by converting it to float and assigning it to every component.</summary>
191 /// <param name="v">int to convert to float3x4</param>
192 /// <returns>Converted value.</returns>
193 [MethodImpl(MethodImplOptions.AggressiveInlining)]
194 public static implicit operator float3x4(int v) { return new float3x4(v); }
195
196 /// <summary>Implicitly converts a int3x4 matrix to a float3x4 matrix by componentwise conversion.</summary>
197 /// <param name="v">int3x4 to convert to float3x4</param>
198 /// <returns>Converted value.</returns>
199 [MethodImpl(MethodImplOptions.AggressiveInlining)]
200 public static implicit operator float3x4(int3x4 v) { return new float3x4(v); }
201
202 /// <summary>Implicitly converts a single uint value to a float3x4 matrix by converting it to float and assigning it to every component.</summary>
203 /// <param name="v">uint to convert to float3x4</param>
204 /// <returns>Converted value.</returns>
205 [MethodImpl(MethodImplOptions.AggressiveInlining)]
206 public static implicit operator float3x4(uint v) { return new float3x4(v); }
207
208 /// <summary>Implicitly converts a uint3x4 matrix to a float3x4 matrix by componentwise conversion.</summary>
209 /// <param name="v">uint3x4 to convert to float3x4</param>
210 /// <returns>Converted value.</returns>
211 [MethodImpl(MethodImplOptions.AggressiveInlining)]
212 public static implicit operator float3x4(uint3x4 v) { return new float3x4(v); }
213
214 /// <summary>Explicitly converts a single double value to a float3x4 matrix by converting it to float and assigning it to every component.</summary>
215 /// <param name="v">double to convert to float3x4</param>
216 /// <returns>Converted value.</returns>
217 [MethodImpl(MethodImplOptions.AggressiveInlining)]
218 public static explicit operator float3x4(double v) { return new float3x4(v); }
219
220 /// <summary>Explicitly converts a double3x4 matrix to a float3x4 matrix by componentwise conversion.</summary>
221 /// <param name="v">double3x4 to convert to float3x4</param>
222 /// <returns>Converted value.</returns>
223 [MethodImpl(MethodImplOptions.AggressiveInlining)]
224 public static explicit operator float3x4(double3x4 v) { return new float3x4(v); }
225
226
227 /// <summary>Returns the result of a componentwise multiplication operation on two float3x4 matrices.</summary>
228 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise multiplication.</param>
229 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise multiplication.</param>
230 /// <returns>float3x4 result of the componentwise multiplication.</returns>
231 [MethodImpl(MethodImplOptions.AggressiveInlining)]
232 public static float3x4 operator * (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
233
234 /// <summary>Returns the result of a componentwise multiplication operation on a float3x4 matrix and a float value.</summary>
235 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise multiplication.</param>
236 /// <param name="rhs">Right hand side float to use to compute componentwise multiplication.</param>
237 /// <returns>float3x4 result of the componentwise multiplication.</returns>
238 [MethodImpl(MethodImplOptions.AggressiveInlining)]
239 public static float3x4 operator * (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
240
241 /// <summary>Returns the result of a componentwise multiplication operation on a float value and a float3x4 matrix.</summary>
242 /// <param name="lhs">Left hand side float to use to compute componentwise multiplication.</param>
243 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise multiplication.</param>
244 /// <returns>float3x4 result of the componentwise multiplication.</returns>
245 [MethodImpl(MethodImplOptions.AggressiveInlining)]
246 public static float3x4 operator * (float lhs, float3x4 rhs) { return new float3x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
247
248
249 /// <summary>Returns the result of a componentwise addition operation on two float3x4 matrices.</summary>
250 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise addition.</param>
251 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise addition.</param>
252 /// <returns>float3x4 result of the componentwise addition.</returns>
253 [MethodImpl(MethodImplOptions.AggressiveInlining)]
254 public static float3x4 operator + (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
255
256 /// <summary>Returns the result of a componentwise addition operation on a float3x4 matrix and a float value.</summary>
257 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise addition.</param>
258 /// <param name="rhs">Right hand side float to use to compute componentwise addition.</param>
259 /// <returns>float3x4 result of the componentwise addition.</returns>
260 [MethodImpl(MethodImplOptions.AggressiveInlining)]
261 public static float3x4 operator + (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
262
263 /// <summary>Returns the result of a componentwise addition operation on a float value and a float3x4 matrix.</summary>
264 /// <param name="lhs">Left hand side float to use to compute componentwise addition.</param>
265 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise addition.</param>
266 /// <returns>float3x4 result of the componentwise addition.</returns>
267 [MethodImpl(MethodImplOptions.AggressiveInlining)]
268 public static float3x4 operator + (float lhs, float3x4 rhs) { return new float3x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
269
270
271 /// <summary>Returns the result of a componentwise subtraction operation on two float3x4 matrices.</summary>
272 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise subtraction.</param>
273 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise subtraction.</param>
274 /// <returns>float3x4 result of the componentwise subtraction.</returns>
275 [MethodImpl(MethodImplOptions.AggressiveInlining)]
276 public static float3x4 operator - (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
277
278 /// <summary>Returns the result of a componentwise subtraction operation on a float3x4 matrix and a float value.</summary>
279 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise subtraction.</param>
280 /// <param name="rhs">Right hand side float to use to compute componentwise subtraction.</param>
281 /// <returns>float3x4 result of the componentwise subtraction.</returns>
282 [MethodImpl(MethodImplOptions.AggressiveInlining)]
283 public static float3x4 operator - (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
284
285 /// <summary>Returns the result of a componentwise subtraction operation on a float value and a float3x4 matrix.</summary>
286 /// <param name="lhs">Left hand side float to use to compute componentwise subtraction.</param>
287 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise subtraction.</param>
288 /// <returns>float3x4 result of the componentwise subtraction.</returns>
289 [MethodImpl(MethodImplOptions.AggressiveInlining)]
290 public static float3x4 operator - (float lhs, float3x4 rhs) { return new float3x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
291
292
293 /// <summary>Returns the result of a componentwise division operation on two float3x4 matrices.</summary>
294 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise division.</param>
295 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise division.</param>
296 /// <returns>float3x4 result of the componentwise division.</returns>
297 [MethodImpl(MethodImplOptions.AggressiveInlining)]
298 public static float3x4 operator / (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
299
300 /// <summary>Returns the result of a componentwise division operation on a float3x4 matrix and a float value.</summary>
301 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise division.</param>
302 /// <param name="rhs">Right hand side float to use to compute componentwise division.</param>
303 /// <returns>float3x4 result of the componentwise division.</returns>
304 [MethodImpl(MethodImplOptions.AggressiveInlining)]
305 public static float3x4 operator / (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
306
307 /// <summary>Returns the result of a componentwise division operation on a float value and a float3x4 matrix.</summary>
308 /// <param name="lhs">Left hand side float to use to compute componentwise division.</param>
309 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise division.</param>
310 /// <returns>float3x4 result of the componentwise division.</returns>
311 [MethodImpl(MethodImplOptions.AggressiveInlining)]
312 public static float3x4 operator / (float lhs, float3x4 rhs) { return new float3x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
313
314
315 /// <summary>Returns the result of a componentwise modulus operation on two float3x4 matrices.</summary>
316 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise modulus.</param>
317 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise modulus.</param>
318 /// <returns>float3x4 result of the componentwise modulus.</returns>
319 [MethodImpl(MethodImplOptions.AggressiveInlining)]
320 public static float3x4 operator % (float3x4 lhs, float3x4 rhs) { return new float3x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
321
322 /// <summary>Returns the result of a componentwise modulus operation on a float3x4 matrix and a float value.</summary>
323 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise modulus.</param>
324 /// <param name="rhs">Right hand side float to use to compute componentwise modulus.</param>
325 /// <returns>float3x4 result of the componentwise modulus.</returns>
326 [MethodImpl(MethodImplOptions.AggressiveInlining)]
327 public static float3x4 operator % (float3x4 lhs, float rhs) { return new float3x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
328
329 /// <summary>Returns the result of a componentwise modulus operation on a float value and a float3x4 matrix.</summary>
330 /// <param name="lhs">Left hand side float to use to compute componentwise modulus.</param>
331 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise modulus.</param>
332 /// <returns>float3x4 result of the componentwise modulus.</returns>
333 [MethodImpl(MethodImplOptions.AggressiveInlining)]
334 public static float3x4 operator % (float lhs, float3x4 rhs) { return new float3x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
335
336
337 /// <summary>Returns the result of a componentwise increment operation on a float3x4 matrix.</summary>
338 /// <param name="val">Value to use when computing the componentwise increment.</param>
339 /// <returns>float3x4 result of the componentwise increment.</returns>
340 [MethodImpl(MethodImplOptions.AggressiveInlining)]
341 public static float3x4 operator ++ (float3x4 val) { return new float3x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
342
343
344 /// <summary>Returns the result of a componentwise decrement operation on a float3x4 matrix.</summary>
345 /// <param name="val">Value to use when computing the componentwise decrement.</param>
346 /// <returns>float3x4 result of the componentwise decrement.</returns>
347 [MethodImpl(MethodImplOptions.AggressiveInlining)]
348 public static float3x4 operator -- (float3x4 val) { return new float3x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
349
350
351 /// <summary>Returns the result of a componentwise less than operation on two float3x4 matrices.</summary>
352 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise less than.</param>
353 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise less than.</param>
354 /// <returns>bool3x4 result of the componentwise less than.</returns>
355 [MethodImpl(MethodImplOptions.AggressiveInlining)]
356 public static bool3x4 operator < (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
357
358 /// <summary>Returns the result of a componentwise less than operation on a float3x4 matrix and a float value.</summary>
359 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise less than.</param>
360 /// <param name="rhs">Right hand side float to use to compute componentwise less than.</param>
361 /// <returns>bool3x4 result of the componentwise less than.</returns>
362 [MethodImpl(MethodImplOptions.AggressiveInlining)]
363 public static bool3x4 operator < (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
364
365 /// <summary>Returns the result of a componentwise less than operation on a float value and a float3x4 matrix.</summary>
366 /// <param name="lhs">Left hand side float to use to compute componentwise less than.</param>
367 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise less than.</param>
368 /// <returns>bool3x4 result of the componentwise less than.</returns>
369 [MethodImpl(MethodImplOptions.AggressiveInlining)]
370 public static bool3x4 operator < (float lhs, float3x4 rhs) { return new bool3x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
371
372
373 /// <summary>Returns the result of a componentwise less or equal operation on two float3x4 matrices.</summary>
374 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise less or equal.</param>
375 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise less or equal.</param>
376 /// <returns>bool3x4 result of the componentwise less or equal.</returns>
377 [MethodImpl(MethodImplOptions.AggressiveInlining)]
378 public static bool3x4 operator <= (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
379
380 /// <summary>Returns the result of a componentwise less or equal operation on a float3x4 matrix and a float value.</summary>
381 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise less or equal.</param>
382 /// <param name="rhs">Right hand side float to use to compute componentwise less or equal.</param>
383 /// <returns>bool3x4 result of the componentwise less or equal.</returns>
384 [MethodImpl(MethodImplOptions.AggressiveInlining)]
385 public static bool3x4 operator <= (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
386
387 /// <summary>Returns the result of a componentwise less or equal operation on a float value and a float3x4 matrix.</summary>
388 /// <param name="lhs">Left hand side float to use to compute componentwise less or equal.</param>
389 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise less or equal.</param>
390 /// <returns>bool3x4 result of the componentwise less or equal.</returns>
391 [MethodImpl(MethodImplOptions.AggressiveInlining)]
392 public static bool3x4 operator <= (float lhs, float3x4 rhs) { return new bool3x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
393
394
395 /// <summary>Returns the result of a componentwise greater than operation on two float3x4 matrices.</summary>
396 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise greater than.</param>
397 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise greater than.</param>
398 /// <returns>bool3x4 result of the componentwise greater than.</returns>
399 [MethodImpl(MethodImplOptions.AggressiveInlining)]
400 public static bool3x4 operator > (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
401
402 /// <summary>Returns the result of a componentwise greater than operation on a float3x4 matrix and a float value.</summary>
403 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise greater than.</param>
404 /// <param name="rhs">Right hand side float to use to compute componentwise greater than.</param>
405 /// <returns>bool3x4 result of the componentwise greater than.</returns>
406 [MethodImpl(MethodImplOptions.AggressiveInlining)]
407 public static bool3x4 operator > (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
408
409 /// <summary>Returns the result of a componentwise greater than operation on a float value and a float3x4 matrix.</summary>
410 /// <param name="lhs">Left hand side float to use to compute componentwise greater than.</param>
411 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise greater than.</param>
412 /// <returns>bool3x4 result of the componentwise greater than.</returns>
413 [MethodImpl(MethodImplOptions.AggressiveInlining)]
414 public static bool3x4 operator > (float lhs, float3x4 rhs) { return new bool3x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
415
416
417 /// <summary>Returns the result of a componentwise greater or equal operation on two float3x4 matrices.</summary>
418 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise greater or equal.</param>
419 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise greater or equal.</param>
420 /// <returns>bool3x4 result of the componentwise greater or equal.</returns>
421 [MethodImpl(MethodImplOptions.AggressiveInlining)]
422 public static bool3x4 operator >= (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
423
424 /// <summary>Returns the result of a componentwise greater or equal operation on a float3x4 matrix and a float value.</summary>
425 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise greater or equal.</param>
426 /// <param name="rhs">Right hand side float to use to compute componentwise greater or equal.</param>
427 /// <returns>bool3x4 result of the componentwise greater or equal.</returns>
428 [MethodImpl(MethodImplOptions.AggressiveInlining)]
429 public static bool3x4 operator >= (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
430
431 /// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float3x4 matrix.</summary>
432 /// <param name="lhs">Left hand side float to use to compute componentwise greater or equal.</param>
433 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise greater or equal.</param>
434 /// <returns>bool3x4 result of the componentwise greater or equal.</returns>
435 [MethodImpl(MethodImplOptions.AggressiveInlining)]
436 public static bool3x4 operator >= (float lhs, float3x4 rhs) { return new bool3x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
437
438
439 /// <summary>Returns the result of a componentwise unary minus operation on a float3x4 matrix.</summary>
440 /// <param name="val">Value to use when computing the componentwise unary minus.</param>
441 /// <returns>float3x4 result of the componentwise unary minus.</returns>
442 [MethodImpl(MethodImplOptions.AggressiveInlining)]
443 public static float3x4 operator - (float3x4 val) { return new float3x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
444
445
446 /// <summary>Returns the result of a componentwise unary plus operation on a float3x4 matrix.</summary>
447 /// <param name="val">Value to use when computing the componentwise unary plus.</param>
448 /// <returns>float3x4 result of the componentwise unary plus.</returns>
449 [MethodImpl(MethodImplOptions.AggressiveInlining)]
450 public static float3x4 operator + (float3x4 val) { return new float3x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
451
452
453 /// <summary>Returns the result of a componentwise equality operation on two float3x4 matrices.</summary>
454 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise equality.</param>
455 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise equality.</param>
456 /// <returns>bool3x4 result of the componentwise equality.</returns>
457 [MethodImpl(MethodImplOptions.AggressiveInlining)]
458 public static bool3x4 operator == (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
459
460 /// <summary>Returns the result of a componentwise equality operation on a float3x4 matrix and a float value.</summary>
461 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise equality.</param>
462 /// <param name="rhs">Right hand side float to use to compute componentwise equality.</param>
463 /// <returns>bool3x4 result of the componentwise equality.</returns>
464 [MethodImpl(MethodImplOptions.AggressiveInlining)]
465 public static bool3x4 operator == (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
466
467 /// <summary>Returns the result of a componentwise equality operation on a float value and a float3x4 matrix.</summary>
468 /// <param name="lhs">Left hand side float to use to compute componentwise equality.</param>
469 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise equality.</param>
470 /// <returns>bool3x4 result of the componentwise equality.</returns>
471 [MethodImpl(MethodImplOptions.AggressiveInlining)]
472 public static bool3x4 operator == (float lhs, float3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
473
474
475 /// <summary>Returns the result of a componentwise not equal operation on two float3x4 matrices.</summary>
476 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise not equal.</param>
477 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise not equal.</param>
478 /// <returns>bool3x4 result of the componentwise not equal.</returns>
479 [MethodImpl(MethodImplOptions.AggressiveInlining)]
480 public static bool3x4 operator != (float3x4 lhs, float3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
481
482 /// <summary>Returns the result of a componentwise not equal operation on a float3x4 matrix and a float value.</summary>
483 /// <param name="lhs">Left hand side float3x4 to use to compute componentwise not equal.</param>
484 /// <param name="rhs">Right hand side float to use to compute componentwise not equal.</param>
485 /// <returns>bool3x4 result of the componentwise not equal.</returns>
486 [MethodImpl(MethodImplOptions.AggressiveInlining)]
487 public static bool3x4 operator != (float3x4 lhs, float rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
488
489 /// <summary>Returns the result of a componentwise not equal operation on a float value and a float3x4 matrix.</summary>
490 /// <param name="lhs">Left hand side float to use to compute componentwise not equal.</param>
491 /// <param name="rhs">Right hand side float3x4 to use to compute componentwise not equal.</param>
492 /// <returns>bool3x4 result of the componentwise not equal.</returns>
493 [MethodImpl(MethodImplOptions.AggressiveInlining)]
494 public static bool3x4 operator != (float lhs, float3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
495
496
497
498 /// <summary>Returns the float3 element at a specified index.</summary>
499 unsafe public ref float3 this[int index]
500 {
501 get
502 {
503#if ENABLE_UNITY_COLLECTIONS_CHECKS
504 if ((uint)index >= 4)
505 throw new System.ArgumentException("index must be between[0...3]");
506#endif
507 fixed (float3x4* array = &this) { return ref ((float3*)array)[index]; }
508 }
509 }
510
511 /// <summary>Returns true if the float3x4 is equal to a given float3x4, false otherwise.</summary>
512 /// <param name="rhs">Right hand side argument to compare equality with.</param>
513 /// <returns>The result of the equality comparison.</returns>
514 [MethodImpl(MethodImplOptions.AggressiveInlining)]
515 public bool Equals(float3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
516
517 /// <summary>Returns true if the float3x4 is equal to a given float3x4, false otherwise.</summary>
518 /// <param name="o">Right hand side argument to compare equality with.</param>
519 /// <returns>The result of the equality comparison.</returns>
520 public override bool Equals(object o) { return o is float3x4 converted && Equals(converted); }
521
522
523 /// <summary>Returns a hash code for the float3x4.</summary>
524 /// <returns>The computed hash code.</returns>
525 [MethodImpl(MethodImplOptions.AggressiveInlining)]
526 public override int GetHashCode() { return (int)math.hash(this); }
527
528
529 /// <summary>Returns a string representation of the float3x4.</summary>
530 /// <returns>String representation of the value.</returns>
531 [MethodImpl(MethodImplOptions.AggressiveInlining)]
532 public override string ToString()
533 {
534 return string.Format("float3x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z);
535 }
536
537 /// <summary>Returns a string representation of the float3x4 using a specified format and culture-specific format information.</summary>
538 /// <param name="format">Format string to use during string formatting.</param>
539 /// <param name="formatProvider">Format provider to use during string formatting.</param>
540 /// <returns>String representation of the value.</returns>
541 [MethodImpl(MethodImplOptions.AggressiveInlining)]
542 public string ToString(string format, IFormatProvider formatProvider)
543 {
544 return string.Format("float3x4({0}f, {1}f, {2}f, {3}f, {4}f, {5}f, {6}f, {7}f, {8}f, {9}f, {10}f, {11}f)", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider));
545 }
546
547 }
548
549 public static partial class math
550 {
551 /// <summary>Returns a float3x4 matrix constructed from four float3 vectors.</summary>
552 /// <param name="c0">The matrix column c0 will be set to this value.</param>
553 /// <param name="c1">The matrix column c1 will be set to this value.</param>
554 /// <param name="c2">The matrix column c2 will be set to this value.</param>
555 /// <param name="c3">The matrix column c3 will be set to this value.</param>
556 /// <returns>float3x4 constructed from arguments.</returns>
557 [MethodImpl(MethodImplOptions.AggressiveInlining)]
558 public static float3x4 float3x4(float3 c0, float3 c1, float3 c2, float3 c3) { return new float3x4(c0, c1, c2, c3); }
559
560 /// <summary>Returns a float3x4 matrix constructed from from 12 float values given in row-major order.</summary>
561 /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
562 /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
563 /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
564 /// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
565 /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
566 /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
567 /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
568 /// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
569 /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
570 /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
571 /// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
572 /// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
573 /// <returns>float3x4 constructed from arguments.</returns>
574 [MethodImpl(MethodImplOptions.AggressiveInlining)]
575 public static float3x4 float3x4(float m00, float m01, float m02, float m03,
576 float m10, float m11, float m12, float m13,
577 float m20, float m21, float m22, float m23)
578 {
579 return new float3x4(m00, m01, m02, m03,
580 m10, m11, m12, m13,
581 m20, m21, m22, m23);
582 }
583
584 /// <summary>Returns a float3x4 matrix constructed from a single float value by assigning it to every component.</summary>
585 /// <param name="v">float to convert to float3x4</param>
586 /// <returns>Converted value.</returns>
587 [MethodImpl(MethodImplOptions.AggressiveInlining)]
588 public static float3x4 float3x4(float v) { return new float3x4(v); }
589
590 /// <summary>Returns a float3x4 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
591 /// <param name="v">bool to convert to float3x4</param>
592 /// <returns>Converted value.</returns>
593 [MethodImpl(MethodImplOptions.AggressiveInlining)]
594 public static float3x4 float3x4(bool v) { return new float3x4(v); }
595
596 /// <summary>Return a float3x4 matrix constructed from a bool3x4 matrix by componentwise conversion.</summary>
597 /// <param name="v">bool3x4 to convert to float3x4</param>
598 /// <returns>Converted value.</returns>
599 [MethodImpl(MethodImplOptions.AggressiveInlining)]
600 public static float3x4 float3x4(bool3x4 v) { return new float3x4(v); }
601
602 /// <summary>Returns a float3x4 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
603 /// <param name="v">int to convert to float3x4</param>
604 /// <returns>Converted value.</returns>
605 [MethodImpl(MethodImplOptions.AggressiveInlining)]
606 public static float3x4 float3x4(int v) { return new float3x4(v); }
607
608 /// <summary>Return a float3x4 matrix constructed from a int3x4 matrix by componentwise conversion.</summary>
609 /// <param name="v">int3x4 to convert to float3x4</param>
610 /// <returns>Converted value.</returns>
611 [MethodImpl(MethodImplOptions.AggressiveInlining)]
612 public static float3x4 float3x4(int3x4 v) { return new float3x4(v); }
613
614 /// <summary>Returns a float3x4 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
615 /// <param name="v">uint to convert to float3x4</param>
616 /// <returns>Converted value.</returns>
617 [MethodImpl(MethodImplOptions.AggressiveInlining)]
618 public static float3x4 float3x4(uint v) { return new float3x4(v); }
619
620 /// <summary>Return a float3x4 matrix constructed from a uint3x4 matrix by componentwise conversion.</summary>
621 /// <param name="v">uint3x4 to convert to float3x4</param>
622 /// <returns>Converted value.</returns>
623 [MethodImpl(MethodImplOptions.AggressiveInlining)]
624 public static float3x4 float3x4(uint3x4 v) { return new float3x4(v); }
625
626 /// <summary>Returns a float3x4 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
627 /// <param name="v">double to convert to float3x4</param>
628 /// <returns>Converted value.</returns>
629 [MethodImpl(MethodImplOptions.AggressiveInlining)]
630 public static float3x4 float3x4(double v) { return new float3x4(v); }
631
632 /// <summary>Return a float3x4 matrix constructed from a double3x4 matrix by componentwise conversion.</summary>
633 /// <param name="v">double3x4 to convert to float3x4</param>
634 /// <returns>Converted value.</returns>
635 [MethodImpl(MethodImplOptions.AggressiveInlining)]
636 public static float3x4 float3x4(double3x4 v) { return new float3x4(v); }
637
638 /// <summary>Return the float4x3 transpose of a float3x4 matrix.</summary>
639 /// <param name="v">Value to transpose.</param>
640 /// <returns>Transposed value.</returns>
641 [MethodImpl(MethodImplOptions.AggressiveInlining)]
642 public static float4x3 transpose(float3x4 v)
643 {
644 return float4x3(
645 v.c0.x, v.c0.y, v.c0.z,
646 v.c1.x, v.c1.y, v.c1.z,
647 v.c2.x, v.c2.y, v.c2.z,
648 v.c3.x, v.c3.y, v.c3.z);
649 }
650
651 /// <summary>Fast matrix inverse for rigid transforms (orthonormal basis and translation)</summary>
652 /// <param name="m">Matrix to invert.</param>
653 /// <returns>The inverted matrix.</returns>
654 public static float3x4 fastinverse(float3x4 m)
655 {
656 float3 c0 = m.c0;
657 float3 c1 = m.c1;
658 float3 c2 = m.c2;
659 float3 pos = m.c3;
660
661 float3 r0 = float3(c0.x, c1.x, c2.x);
662 float3 r1 = float3(c0.y, c1.y, c2.y);
663 float3 r2 = float3(c0.z, c1.z, c2.z);
664
665 pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z);
666
667 return float3x4(r0, r1, r2, pos);
668 }
669
670 /// <summary>Returns a uint hash code of a float3x4 matrix.</summary>
671 /// <param name="v">Matrix value to hash.</param>
672 /// <returns>uint hash of the argument.</returns>
673 [MethodImpl(MethodImplOptions.AggressiveInlining)]
674 public static uint hash(float3x4 v)
675 {
676 return csum(asuint(v.c0) * uint3(0xF9EA92D5u, 0xC2FAFCB9u, 0x616E9CA1u) +
677 asuint(v.c1) * uint3(0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u) +
678 asuint(v.c2) * uint3(0xF83BD927u, 0x6A243BCBu, 0x509B84C9u) +
679 asuint(v.c3) * uint3(0x91D13847u, 0x52F7230Fu, 0xCF286E83u)) + 0xE121E6ADu;
680 }
681
682 /// <summary>
683 /// Returns a uint3 vector hash code of a float3x4 matrix.
684 /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
685 /// that are only reduced to a narrow uint hash at the very end instead of at every step.
686 /// </summary>
687 /// <param name="v">Matrix value to hash.</param>
688 /// <returns>uint3 hash of the argument.</returns>
689 [MethodImpl(MethodImplOptions.AggressiveInlining)]
690 public static uint3 hashwide(float3x4 v)
691 {
692 return (asuint(v.c0) * uint3(0xC9CA1249u, 0x69B60C81u, 0xE0EB6C25u) +
693 asuint(v.c1) * uint3(0xF648BEABu, 0x6BDB2B07u, 0xEF63C699u) +
694 asuint(v.c2) * uint3(0x9001903Fu, 0xA895B9CDu, 0x9D23B201u) +
695 asuint(v.c3) * uint3(0x4B01D3E1u, 0x7461CA0Du, 0x79725379u)) + 0xD6258E5Bu;
696 }
697
698 }
699}