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