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