A game about forced loneliness, made by TACStudios
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 763 lines 50 kB view raw
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 ints.</summary> 18 [System.Serializable] 19 [Il2CppEagerStaticClassConstruction] 20 public partial struct int3x3 : System.IEquatable<int3x3>, IFormattable 21 { 22 /// <summary>Column 0 of the matrix.</summary> 23 public int3 c0; 24 /// <summary>Column 1 of the matrix.</summary> 25 public int3 c1; 26 /// <summary>Column 2 of the matrix.</summary> 27 public int3 c2; 28 29 /// <summary>int3x3 identity transform.</summary> 30 public static readonly int3x3 identity = new int3x3(1, 0, 0, 0, 1, 0, 0, 0, 1); 31 32 /// <summary>int3x3 zero value.</summary> 33 public static readonly int3x3 zero; 34 35 /// <summary>Constructs a int3x3 matrix from three int3 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 int3x3(int3 c0, int3 c1, int3 c2) 41 { 42 this.c0 = c0; 43 this.c1 = c1; 44 this.c2 = c2; 45 } 46 47 /// <summary>Constructs a int3x3 matrix from 9 int 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 int3x3(int m00, int m01, int m02, 59 int m10, int m11, int m12, 60 int m20, int m21, int m22) 61 { 62 this.c0 = new int3(m00, m10, m20); 63 this.c1 = new int3(m01, m11, m21); 64 this.c2 = new int3(m02, m12, m22); 65 } 66 67 /// <summary>Constructs a int3x3 matrix from a single int value by assigning it to every component.</summary> 68 /// <param name="v">int to convert to int3x3</param> 69 [MethodImpl(MethodImplOptions.AggressiveInlining)] 70 public int3x3(int v) 71 { 72 this.c0 = v; 73 this.c1 = v; 74 this.c2 = v; 75 } 76 77 /// <summary>Constructs a int3x3 matrix from a single bool value by converting it to int and assigning it to every component.</summary> 78 /// <param name="v">bool to convert to int3x3</param> 79 [MethodImpl(MethodImplOptions.AggressiveInlining)] 80 public int3x3(bool v) 81 { 82 this.c0 = math.select(new int3(0), new int3(1), v); 83 this.c1 = math.select(new int3(0), new int3(1), v); 84 this.c2 = math.select(new int3(0), new int3(1), v); 85 } 86 87 /// <summary>Constructs a int3x3 matrix from a bool3x3 matrix by componentwise conversion.</summary> 88 /// <param name="v">bool3x3 to convert to int3x3</param> 89 [MethodImpl(MethodImplOptions.AggressiveInlining)] 90 public int3x3(bool3x3 v) 91 { 92 this.c0 = math.select(new int3(0), new int3(1), v.c0); 93 this.c1 = math.select(new int3(0), new int3(1), v.c1); 94 this.c2 = math.select(new int3(0), new int3(1), v.c2); 95 } 96 97 /// <summary>Constructs a int3x3 matrix from a single uint value by converting it to int and assigning it to every component.</summary> 98 /// <param name="v">uint to convert to int3x3</param> 99 [MethodImpl(MethodImplOptions.AggressiveInlining)] 100 public int3x3(uint v) 101 { 102 this.c0 = (int3)v; 103 this.c1 = (int3)v; 104 this.c2 = (int3)v; 105 } 106 107 /// <summary>Constructs a int3x3 matrix from a uint3x3 matrix by componentwise conversion.</summary> 108 /// <param name="v">uint3x3 to convert to int3x3</param> 109 [MethodImpl(MethodImplOptions.AggressiveInlining)] 110 public int3x3(uint3x3 v) 111 { 112 this.c0 = (int3)v.c0; 113 this.c1 = (int3)v.c1; 114 this.c2 = (int3)v.c2; 115 } 116 117 /// <summary>Constructs a int3x3 matrix from a single float value by converting it to int and assigning it to every component.</summary> 118 /// <param name="v">float to convert to int3x3</param> 119 [MethodImpl(MethodImplOptions.AggressiveInlining)] 120 public int3x3(float v) 121 { 122 this.c0 = (int3)v; 123 this.c1 = (int3)v; 124 this.c2 = (int3)v; 125 } 126 127 /// <summary>Constructs a int3x3 matrix from a float3x3 matrix by componentwise conversion.</summary> 128 /// <param name="v">float3x3 to convert to int3x3</param> 129 [MethodImpl(MethodImplOptions.AggressiveInlining)] 130 public int3x3(float3x3 v) 131 { 132 this.c0 = (int3)v.c0; 133 this.c1 = (int3)v.c1; 134 this.c2 = (int3)v.c2; 135 } 136 137 /// <summary>Constructs a int3x3 matrix from a single double value by converting it to int and assigning it to every component.</summary> 138 /// <param name="v">double to convert to int3x3</param> 139 [MethodImpl(MethodImplOptions.AggressiveInlining)] 140 public int3x3(double v) 141 { 142 this.c0 = (int3)v; 143 this.c1 = (int3)v; 144 this.c2 = (int3)v; 145 } 146 147 /// <summary>Constructs a int3x3 matrix from a double3x3 matrix by componentwise conversion.</summary> 148 /// <param name="v">double3x3 to convert to int3x3</param> 149 [MethodImpl(MethodImplOptions.AggressiveInlining)] 150 public int3x3(double3x3 v) 151 { 152 this.c0 = (int3)v.c0; 153 this.c1 = (int3)v.c1; 154 this.c2 = (int3)v.c2; 155 } 156 157 158 /// <summary>Implicitly converts a single int value to a int3x3 matrix by assigning it to every component.</summary> 159 /// <param name="v">int to convert to int3x3</param> 160 /// <returns>Converted value.</returns> 161 [MethodImpl(MethodImplOptions.AggressiveInlining)] 162 public static implicit operator int3x3(int v) { return new int3x3(v); } 163 164 /// <summary>Explicitly converts a single bool value to a int3x3 matrix by converting it to int and assigning it to every component.</summary> 165 /// <param name="v">bool to convert to int3x3</param> 166 /// <returns>Converted value.</returns> 167 [MethodImpl(MethodImplOptions.AggressiveInlining)] 168 public static explicit operator int3x3(bool v) { return new int3x3(v); } 169 170 /// <summary>Explicitly converts a bool3x3 matrix to a int3x3 matrix by componentwise conversion.</summary> 171 /// <param name="v">bool3x3 to convert to int3x3</param> 172 /// <returns>Converted value.</returns> 173 [MethodImpl(MethodImplOptions.AggressiveInlining)] 174 public static explicit operator int3x3(bool3x3 v) { return new int3x3(v); } 175 176 /// <summary>Explicitly converts a single uint value to a int3x3 matrix by converting it to int and assigning it to every component.</summary> 177 /// <param name="v">uint to convert to int3x3</param> 178 /// <returns>Converted value.</returns> 179 [MethodImpl(MethodImplOptions.AggressiveInlining)] 180 public static explicit operator int3x3(uint v) { return new int3x3(v); } 181 182 /// <summary>Explicitly converts a uint3x3 matrix to a int3x3 matrix by componentwise conversion.</summary> 183 /// <param name="v">uint3x3 to convert to int3x3</param> 184 /// <returns>Converted value.</returns> 185 [MethodImpl(MethodImplOptions.AggressiveInlining)] 186 public static explicit operator int3x3(uint3x3 v) { return new int3x3(v); } 187 188 /// <summary>Explicitly converts a single float value to a int3x3 matrix by converting it to int and assigning it to every component.</summary> 189 /// <param name="v">float to convert to int3x3</param> 190 /// <returns>Converted value.</returns> 191 [MethodImpl(MethodImplOptions.AggressiveInlining)] 192 public static explicit operator int3x3(float v) { return new int3x3(v); } 193 194 /// <summary>Explicitly converts a float3x3 matrix to a int3x3 matrix by componentwise conversion.</summary> 195 /// <param name="v">float3x3 to convert to int3x3</param> 196 /// <returns>Converted value.</returns> 197 [MethodImpl(MethodImplOptions.AggressiveInlining)] 198 public static explicit operator int3x3(float3x3 v) { return new int3x3(v); } 199 200 /// <summary>Explicitly converts a single double value to a int3x3 matrix by converting it to int and assigning it to every component.</summary> 201 /// <param name="v">double to convert to int3x3</param> 202 /// <returns>Converted value.</returns> 203 [MethodImpl(MethodImplOptions.AggressiveInlining)] 204 public static explicit operator int3x3(double v) { return new int3x3(v); } 205 206 /// <summary>Explicitly converts a double3x3 matrix to a int3x3 matrix by componentwise conversion.</summary> 207 /// <param name="v">double3x3 to convert to int3x3</param> 208 /// <returns>Converted value.</returns> 209 [MethodImpl(MethodImplOptions.AggressiveInlining)] 210 public static explicit operator int3x3(double3x3 v) { return new int3x3(v); } 211 212 213 /// <summary>Returns the result of a componentwise multiplication operation on two int3x3 matrices.</summary> 214 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise multiplication.</param> 215 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise multiplication.</param> 216 /// <returns>int3x3 result of the componentwise multiplication.</returns> 217 [MethodImpl(MethodImplOptions.AggressiveInlining)] 218 public static int3x3 operator * (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2); } 219 220 /// <summary>Returns the result of a componentwise multiplication operation on an int3x3 matrix and an int value.</summary> 221 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise multiplication.</param> 222 /// <param name="rhs">Right hand side int to use to compute componentwise multiplication.</param> 223 /// <returns>int3x3 result of the componentwise multiplication.</returns> 224 [MethodImpl(MethodImplOptions.AggressiveInlining)] 225 public static int3x3 operator * (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs); } 226 227 /// <summary>Returns the result of a componentwise multiplication operation on an int value and an int3x3 matrix.</summary> 228 /// <param name="lhs">Left hand side int to use to compute componentwise multiplication.</param> 229 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise multiplication.</param> 230 /// <returns>int3x3 result of the componentwise multiplication.</returns> 231 [MethodImpl(MethodImplOptions.AggressiveInlining)] 232 public static int3x3 operator * (int lhs, int3x3 rhs) { return new int3x3 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2); } 233 234 235 /// <summary>Returns the result of a componentwise addition operation on two int3x3 matrices.</summary> 236 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise addition.</param> 237 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise addition.</param> 238 /// <returns>int3x3 result of the componentwise addition.</returns> 239 [MethodImpl(MethodImplOptions.AggressiveInlining)] 240 public static int3x3 operator + (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2); } 241 242 /// <summary>Returns the result of a componentwise addition operation on an int3x3 matrix and an int value.</summary> 243 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise addition.</param> 244 /// <param name="rhs">Right hand side int to use to compute componentwise addition.</param> 245 /// <returns>int3x3 result of the componentwise addition.</returns> 246 [MethodImpl(MethodImplOptions.AggressiveInlining)] 247 public static int3x3 operator + (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs); } 248 249 /// <summary>Returns the result of a componentwise addition operation on an int value and an int3x3 matrix.</summary> 250 /// <param name="lhs">Left hand side int to use to compute componentwise addition.</param> 251 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise addition.</param> 252 /// <returns>int3x3 result of the componentwise addition.</returns> 253 [MethodImpl(MethodImplOptions.AggressiveInlining)] 254 public static int3x3 operator + (int lhs, int3x3 rhs) { return new int3x3 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2); } 255 256 257 /// <summary>Returns the result of a componentwise subtraction operation on two int3x3 matrices.</summary> 258 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise subtraction.</param> 259 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise subtraction.</param> 260 /// <returns>int3x3 result of the componentwise subtraction.</returns> 261 [MethodImpl(MethodImplOptions.AggressiveInlining)] 262 public static int3x3 operator - (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2); } 263 264 /// <summary>Returns the result of a componentwise subtraction operation on an int3x3 matrix and an int value.</summary> 265 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise subtraction.</param> 266 /// <param name="rhs">Right hand side int to use to compute componentwise subtraction.</param> 267 /// <returns>int3x3 result of the componentwise subtraction.</returns> 268 [MethodImpl(MethodImplOptions.AggressiveInlining)] 269 public static int3x3 operator - (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs); } 270 271 /// <summary>Returns the result of a componentwise subtraction operation on an int value and an int3x3 matrix.</summary> 272 /// <param name="lhs">Left hand side int to use to compute componentwise subtraction.</param> 273 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise subtraction.</param> 274 /// <returns>int3x3 result of the componentwise subtraction.</returns> 275 [MethodImpl(MethodImplOptions.AggressiveInlining)] 276 public static int3x3 operator - (int lhs, int3x3 rhs) { return new int3x3 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2); } 277 278 279 /// <summary>Returns the result of a componentwise division operation on two int3x3 matrices.</summary> 280 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise division.</param> 281 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise division.</param> 282 /// <returns>int3x3 result of the componentwise division.</returns> 283 [MethodImpl(MethodImplOptions.AggressiveInlining)] 284 public static int3x3 operator / (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2); } 285 286 /// <summary>Returns the result of a componentwise division operation on an int3x3 matrix and an int value.</summary> 287 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise division.</param> 288 /// <param name="rhs">Right hand side int to use to compute componentwise division.</param> 289 /// <returns>int3x3 result of the componentwise division.</returns> 290 [MethodImpl(MethodImplOptions.AggressiveInlining)] 291 public static int3x3 operator / (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs); } 292 293 /// <summary>Returns the result of a componentwise division operation on an int value and an int3x3 matrix.</summary> 294 /// <param name="lhs">Left hand side int to use to compute componentwise division.</param> 295 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise division.</param> 296 /// <returns>int3x3 result of the componentwise division.</returns> 297 [MethodImpl(MethodImplOptions.AggressiveInlining)] 298 public static int3x3 operator / (int lhs, int3x3 rhs) { return new int3x3 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2); } 299 300 301 /// <summary>Returns the result of a componentwise modulus operation on two int3x3 matrices.</summary> 302 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise modulus.</param> 303 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise modulus.</param> 304 /// <returns>int3x3 result of the componentwise modulus.</returns> 305 [MethodImpl(MethodImplOptions.AggressiveInlining)] 306 public static int3x3 operator % (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2); } 307 308 /// <summary>Returns the result of a componentwise modulus operation on an int3x3 matrix and an int value.</summary> 309 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise modulus.</param> 310 /// <param name="rhs">Right hand side int to use to compute componentwise modulus.</param> 311 /// <returns>int3x3 result of the componentwise modulus.</returns> 312 [MethodImpl(MethodImplOptions.AggressiveInlining)] 313 public static int3x3 operator % (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs); } 314 315 /// <summary>Returns the result of a componentwise modulus operation on an int value and an int3x3 matrix.</summary> 316 /// <param name="lhs">Left hand side int to use to compute componentwise modulus.</param> 317 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise modulus.</param> 318 /// <returns>int3x3 result of the componentwise modulus.</returns> 319 [MethodImpl(MethodImplOptions.AggressiveInlining)] 320 public static int3x3 operator % (int lhs, int3x3 rhs) { return new int3x3 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2); } 321 322 323 /// <summary>Returns the result of a componentwise increment operation on an int3x3 matrix.</summary> 324 /// <param name="val">Value to use when computing the componentwise increment.</param> 325 /// <returns>int3x3 result of the componentwise increment.</returns> 326 [MethodImpl(MethodImplOptions.AggressiveInlining)] 327 public static int3x3 operator ++ (int3x3 val) { return new int3x3 (++val.c0, ++val.c1, ++val.c2); } 328 329 330 /// <summary>Returns the result of a componentwise decrement operation on an int3x3 matrix.</summary> 331 /// <param name="val">Value to use when computing the componentwise decrement.</param> 332 /// <returns>int3x3 result of the componentwise decrement.</returns> 333 [MethodImpl(MethodImplOptions.AggressiveInlining)] 334 public static int3x3 operator -- (int3x3 val) { return new int3x3 (--val.c0, --val.c1, --val.c2); } 335 336 337 /// <summary>Returns the result of a componentwise less than operation on two int3x3 matrices.</summary> 338 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise less than.</param> 339 /// <param name="rhs">Right hand side int3x3 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 < (int3x3 lhs, int3x3 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 an int3x3 matrix and an int value.</summary> 345 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise less than.</param> 346 /// <param name="rhs">Right hand side int 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 < (int3x3 lhs, int 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 an int value and an int3x3 matrix.</summary> 352 /// <param name="lhs">Left hand side int to use to compute componentwise less than.</param> 353 /// <param name="rhs">Right hand side int3x3 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 < (int lhs, int3x3 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 int3x3 matrices.</summary> 360 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise less or equal.</param> 361 /// <param name="rhs">Right hand side int3x3 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 <= (int3x3 lhs, int3x3 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 an int3x3 matrix and an int value.</summary> 367 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise less or equal.</param> 368 /// <param name="rhs">Right hand side int 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 <= (int3x3 lhs, int 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 an int value and an int3x3 matrix.</summary> 374 /// <param name="lhs">Left hand side int to use to compute componentwise less or equal.</param> 375 /// <param name="rhs">Right hand side int3x3 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 <= (int lhs, int3x3 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 int3x3 matrices.</summary> 382 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise greater than.</param> 383 /// <param name="rhs">Right hand side int3x3 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 > (int3x3 lhs, int3x3 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 an int3x3 matrix and an int value.</summary> 389 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise greater than.</param> 390 /// <param name="rhs">Right hand side int 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 > (int3x3 lhs, int 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 an int value and an int3x3 matrix.</summary> 396 /// <param name="lhs">Left hand side int to use to compute componentwise greater than.</param> 397 /// <param name="rhs">Right hand side int3x3 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 > (int lhs, int3x3 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 int3x3 matrices.</summary> 404 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise greater or equal.</param> 405 /// <param name="rhs">Right hand side int3x3 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 >= (int3x3 lhs, int3x3 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 an int3x3 matrix and an int value.</summary> 411 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise greater or equal.</param> 412 /// <param name="rhs">Right hand side int 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 >= (int3x3 lhs, int 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 an int value and an int3x3 matrix.</summary> 418 /// <param name="lhs">Left hand side int to use to compute componentwise greater or equal.</param> 419 /// <param name="rhs">Right hand side int3x3 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 >= (int lhs, int3x3 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 an int3x3 matrix.</summary> 426 /// <param name="val">Value to use when computing the componentwise unary minus.</param> 427 /// <returns>int3x3 result of the componentwise unary minus.</returns> 428 [MethodImpl(MethodImplOptions.AggressiveInlining)] 429 public static int3x3 operator - (int3x3 val) { return new int3x3 (-val.c0, -val.c1, -val.c2); } 430 431 432 /// <summary>Returns the result of a componentwise unary plus operation on an int3x3 matrix.</summary> 433 /// <param name="val">Value to use when computing the componentwise unary plus.</param> 434 /// <returns>int3x3 result of the componentwise unary plus.</returns> 435 [MethodImpl(MethodImplOptions.AggressiveInlining)] 436 public static int3x3 operator + (int3x3 val) { return new int3x3 (+val.c0, +val.c1, +val.c2); } 437 438 439 /// <summary>Returns the result of a componentwise left shift operation on an int3x3 matrix by a number of bits specified by a single int.</summary> 440 /// <param name="x">The matrix to left shift.</param> 441 /// <param name="n">The number of bits to left shift.</param> 442 /// <returns>The result of the componentwise left shift.</returns> 443 [MethodImpl(MethodImplOptions.AggressiveInlining)] 444 public static int3x3 operator << (int3x3 x, int n) { return new int3x3 (x.c0 << n, x.c1 << n, x.c2 << n); } 445 446 /// <summary>Returns the result of a componentwise right shift operation on an int3x3 matrix by a number of bits specified by a single int.</summary> 447 /// <param name="x">The matrix to right shift.</param> 448 /// <param name="n">The number of bits to right shift.</param> 449 /// <returns>The result of the componentwise right shift.</returns> 450 [MethodImpl(MethodImplOptions.AggressiveInlining)] 451 public static int3x3 operator >> (int3x3 x, int n) { return new int3x3 (x.c0 >> n, x.c1 >> n, x.c2 >> n); } 452 453 /// <summary>Returns the result of a componentwise equality operation on two int3x3 matrices.</summary> 454 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise equality.</param> 455 /// <param name="rhs">Right hand side int3x3 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 == (int3x3 lhs, int3x3 rhs) { return new bool3x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); } 459 460 /// <summary>Returns the result of a componentwise equality operation on an int3x3 matrix and an int value.</summary> 461 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise equality.</param> 462 /// <param name="rhs">Right hand side int to use to compute componentwise equality.</param> 463 /// <returns>bool3x3 result of the componentwise equality.</returns> 464 [MethodImpl(MethodImplOptions.AggressiveInlining)] 465 public static bool3x3 operator == (int3x3 lhs, int rhs) { return new bool3x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); } 466 467 /// <summary>Returns the result of a componentwise equality operation on an int value and an int3x3 matrix.</summary> 468 /// <param name="lhs">Left hand side int to use to compute componentwise equality.</param> 469 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise equality.</param> 470 /// <returns>bool3x3 result of the componentwise equality.</returns> 471 [MethodImpl(MethodImplOptions.AggressiveInlining)] 472 public static bool3x3 operator == (int lhs, int3x3 rhs) { return new bool3x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); } 473 474 475 /// <summary>Returns the result of a componentwise not equal operation on two int3x3 matrices.</summary> 476 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise not equal.</param> 477 /// <param name="rhs">Right hand side int3x3 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 != (int3x3 lhs, int3x3 rhs) { return new bool3x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); } 481 482 /// <summary>Returns the result of a componentwise not equal operation on an int3x3 matrix and an int value.</summary> 483 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise not equal.</param> 484 /// <param name="rhs">Right hand side int to use to compute componentwise not equal.</param> 485 /// <returns>bool3x3 result of the componentwise not equal.</returns> 486 [MethodImpl(MethodImplOptions.AggressiveInlining)] 487 public static bool3x3 operator != (int3x3 lhs, int rhs) { return new bool3x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); } 488 489 /// <summary>Returns the result of a componentwise not equal operation on an int value and an int3x3 matrix.</summary> 490 /// <param name="lhs">Left hand side int to use to compute componentwise not equal.</param> 491 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise not equal.</param> 492 /// <returns>bool3x3 result of the componentwise not equal.</returns> 493 [MethodImpl(MethodImplOptions.AggressiveInlining)] 494 public static bool3x3 operator != (int lhs, int3x3 rhs) { return new bool3x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); } 495 496 497 /// <summary>Returns the result of a componentwise bitwise not operation on an int3x3 matrix.</summary> 498 /// <param name="val">Value to use when computing the componentwise bitwise not.</param> 499 /// <returns>int3x3 result of the componentwise bitwise not.</returns> 500 [MethodImpl(MethodImplOptions.AggressiveInlining)] 501 public static int3x3 operator ~ (int3x3 val) { return new int3x3 (~val.c0, ~val.c1, ~val.c2); } 502 503 504 /// <summary>Returns the result of a componentwise bitwise and operation on two int3x3 matrices.</summary> 505 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise bitwise and.</param> 506 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise bitwise and.</param> 507 /// <returns>int3x3 result of the componentwise bitwise and.</returns> 508 [MethodImpl(MethodImplOptions.AggressiveInlining)] 509 public static int3x3 operator & (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); } 510 511 /// <summary>Returns the result of a componentwise bitwise and operation on an int3x3 matrix and an int value.</summary> 512 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise bitwise and.</param> 513 /// <param name="rhs">Right hand side int to use to compute componentwise bitwise and.</param> 514 /// <returns>int3x3 result of the componentwise bitwise and.</returns> 515 [MethodImpl(MethodImplOptions.AggressiveInlining)] 516 public static int3x3 operator & (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); } 517 518 /// <summary>Returns the result of a componentwise bitwise and operation on an int value and an int3x3 matrix.</summary> 519 /// <param name="lhs">Left hand side int to use to compute componentwise bitwise and.</param> 520 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise bitwise and.</param> 521 /// <returns>int3x3 result of the componentwise bitwise and.</returns> 522 [MethodImpl(MethodImplOptions.AggressiveInlining)] 523 public static int3x3 operator & (int lhs, int3x3 rhs) { return new int3x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); } 524 525 526 /// <summary>Returns the result of a componentwise bitwise or operation on two int3x3 matrices.</summary> 527 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise bitwise or.</param> 528 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise bitwise or.</param> 529 /// <returns>int3x3 result of the componentwise bitwise or.</returns> 530 [MethodImpl(MethodImplOptions.AggressiveInlining)] 531 public static int3x3 operator | (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); } 532 533 /// <summary>Returns the result of a componentwise bitwise or operation on an int3x3 matrix and an int value.</summary> 534 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise bitwise or.</param> 535 /// <param name="rhs">Right hand side int to use to compute componentwise bitwise or.</param> 536 /// <returns>int3x3 result of the componentwise bitwise or.</returns> 537 [MethodImpl(MethodImplOptions.AggressiveInlining)] 538 public static int3x3 operator | (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); } 539 540 /// <summary>Returns the result of a componentwise bitwise or operation on an int value and an int3x3 matrix.</summary> 541 /// <param name="lhs">Left hand side int to use to compute componentwise bitwise or.</param> 542 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise bitwise or.</param> 543 /// <returns>int3x3 result of the componentwise bitwise or.</returns> 544 [MethodImpl(MethodImplOptions.AggressiveInlining)] 545 public static int3x3 operator | (int lhs, int3x3 rhs) { return new int3x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); } 546 547 548 /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two int3x3 matrices.</summary> 549 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise bitwise exclusive or.</param> 550 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise bitwise exclusive or.</param> 551 /// <returns>int3x3 result of the componentwise bitwise exclusive or.</returns> 552 [MethodImpl(MethodImplOptions.AggressiveInlining)] 553 public static int3x3 operator ^ (int3x3 lhs, int3x3 rhs) { return new int3x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); } 554 555 /// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int3x3 matrix and an int value.</summary> 556 /// <param name="lhs">Left hand side int3x3 to use to compute componentwise bitwise exclusive or.</param> 557 /// <param name="rhs">Right hand side int to use to compute componentwise bitwise exclusive or.</param> 558 /// <returns>int3x3 result of the componentwise bitwise exclusive or.</returns> 559 [MethodImpl(MethodImplOptions.AggressiveInlining)] 560 public static int3x3 operator ^ (int3x3 lhs, int rhs) { return new int3x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); } 561 562 /// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int value and an int3x3 matrix.</summary> 563 /// <param name="lhs">Left hand side int to use to compute componentwise bitwise exclusive or.</param> 564 /// <param name="rhs">Right hand side int3x3 to use to compute componentwise bitwise exclusive or.</param> 565 /// <returns>int3x3 result of the componentwise bitwise exclusive or.</returns> 566 [MethodImpl(MethodImplOptions.AggressiveInlining)] 567 public static int3x3 operator ^ (int lhs, int3x3 rhs) { return new int3x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); } 568 569 570 571 /// <summary>Returns the int3 element at a specified index.</summary> 572 unsafe public ref int3 this[int index] 573 { 574 get 575 { 576#if ENABLE_UNITY_COLLECTIONS_CHECKS 577 if ((uint)index >= 3) 578 throw new System.ArgumentException("index must be between[0...2]"); 579#endif 580 fixed (int3x3* array = &this) { return ref ((int3*)array)[index]; } 581 } 582 } 583 584 /// <summary>Returns true if the int3x3 is equal to a given int3x3, false otherwise.</summary> 585 /// <param name="rhs">Right hand side argument to compare equality with.</param> 586 /// <returns>The result of the equality comparison.</returns> 587 [MethodImpl(MethodImplOptions.AggressiveInlining)] 588 public bool Equals(int3x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); } 589 590 /// <summary>Returns true if the int3x3 is equal to a given int3x3, false otherwise.</summary> 591 /// <param name="o">Right hand side argument to compare equality with.</param> 592 /// <returns>The result of the equality comparison.</returns> 593 public override bool Equals(object o) { return o is int3x3 converted && Equals(converted); } 594 595 596 /// <summary>Returns a hash code for the int3x3.</summary> 597 /// <returns>The computed hash code.</returns> 598 [MethodImpl(MethodImplOptions.AggressiveInlining)] 599 public override int GetHashCode() { return (int)math.hash(this); } 600 601 602 /// <summary>Returns a string representation of the int3x3.</summary> 603 /// <returns>String representation of the value.</returns> 604 [MethodImpl(MethodImplOptions.AggressiveInlining)] 605 public override string ToString() 606 { 607 return string.Format("int3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z); 608 } 609 610 /// <summary>Returns a string representation of the int3x3 using a specified format and culture-specific format information.</summary> 611 /// <param name="format">Format string to use during string formatting.</param> 612 /// <param name="formatProvider">Format provider to use during string formatting.</param> 613 /// <returns>String representation of the value.</returns> 614 [MethodImpl(MethodImplOptions.AggressiveInlining)] 615 public string ToString(string format, IFormatProvider formatProvider) 616 { 617 return string.Format("int3x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8})", 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)); 618 } 619 620 } 621 622 public static partial class math 623 { 624 /// <summary>Returns a int3x3 matrix constructed from three int3 vectors.</summary> 625 /// <param name="c0">The matrix column c0 will be set to this value.</param> 626 /// <param name="c1">The matrix column c1 will be set to this value.</param> 627 /// <param name="c2">The matrix column c2 will be set to this value.</param> 628 /// <returns>int3x3 constructed from arguments.</returns> 629 [MethodImpl(MethodImplOptions.AggressiveInlining)] 630 public static int3x3 int3x3(int3 c0, int3 c1, int3 c2) { return new int3x3(c0, c1, c2); } 631 632 /// <summary>Returns a int3x3 matrix constructed from from 9 int values given in row-major order.</summary> 633 /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param> 634 /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param> 635 /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param> 636 /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param> 637 /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param> 638 /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param> 639 /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param> 640 /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param> 641 /// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param> 642 /// <returns>int3x3 constructed from arguments.</returns> 643 [MethodImpl(MethodImplOptions.AggressiveInlining)] 644 public static int3x3 int3x3(int m00, int m01, int m02, 645 int m10, int m11, int m12, 646 int m20, int m21, int m22) 647 { 648 return new int3x3(m00, m01, m02, 649 m10, m11, m12, 650 m20, m21, m22); 651 } 652 653 /// <summary>Returns a int3x3 matrix constructed from a single int value by assigning it to every component.</summary> 654 /// <param name="v">int to convert to int3x3</param> 655 /// <returns>Converted value.</returns> 656 [MethodImpl(MethodImplOptions.AggressiveInlining)] 657 public static int3x3 int3x3(int v) { return new int3x3(v); } 658 659 /// <summary>Returns a int3x3 matrix constructed from a single bool value by converting it to int and assigning it to every component.</summary> 660 /// <param name="v">bool to convert to int3x3</param> 661 /// <returns>Converted value.</returns> 662 [MethodImpl(MethodImplOptions.AggressiveInlining)] 663 public static int3x3 int3x3(bool v) { return new int3x3(v); } 664 665 /// <summary>Return a int3x3 matrix constructed from a bool3x3 matrix by componentwise conversion.</summary> 666 /// <param name="v">bool3x3 to convert to int3x3</param> 667 /// <returns>Converted value.</returns> 668 [MethodImpl(MethodImplOptions.AggressiveInlining)] 669 public static int3x3 int3x3(bool3x3 v) { return new int3x3(v); } 670 671 /// <summary>Returns a int3x3 matrix constructed from a single uint value by converting it to int and assigning it to every component.</summary> 672 /// <param name="v">uint to convert to int3x3</param> 673 /// <returns>Converted value.</returns> 674 [MethodImpl(MethodImplOptions.AggressiveInlining)] 675 public static int3x3 int3x3(uint v) { return new int3x3(v); } 676 677 /// <summary>Return a int3x3 matrix constructed from a uint3x3 matrix by componentwise conversion.</summary> 678 /// <param name="v">uint3x3 to convert to int3x3</param> 679 /// <returns>Converted value.</returns> 680 [MethodImpl(MethodImplOptions.AggressiveInlining)] 681 public static int3x3 int3x3(uint3x3 v) { return new int3x3(v); } 682 683 /// <summary>Returns a int3x3 matrix constructed from a single float value by converting it to int and assigning it to every component.</summary> 684 /// <param name="v">float to convert to int3x3</param> 685 /// <returns>Converted value.</returns> 686 [MethodImpl(MethodImplOptions.AggressiveInlining)] 687 public static int3x3 int3x3(float v) { return new int3x3(v); } 688 689 /// <summary>Return a int3x3 matrix constructed from a float3x3 matrix by componentwise conversion.</summary> 690 /// <param name="v">float3x3 to convert to int3x3</param> 691 /// <returns>Converted value.</returns> 692 [MethodImpl(MethodImplOptions.AggressiveInlining)] 693 public static int3x3 int3x3(float3x3 v) { return new int3x3(v); } 694 695 /// <summary>Returns a int3x3 matrix constructed from a single double value by converting it to int and assigning it to every component.</summary> 696 /// <param name="v">double to convert to int3x3</param> 697 /// <returns>Converted value.</returns> 698 [MethodImpl(MethodImplOptions.AggressiveInlining)] 699 public static int3x3 int3x3(double v) { return new int3x3(v); } 700 701 /// <summary>Return a int3x3 matrix constructed from a double3x3 matrix by componentwise conversion.</summary> 702 /// <param name="v">double3x3 to convert to int3x3</param> 703 /// <returns>Converted value.</returns> 704 [MethodImpl(MethodImplOptions.AggressiveInlining)] 705 public static int3x3 int3x3(double3x3 v) { return new int3x3(v); } 706 707 /// <summary>Return the int3x3 transpose of a int3x3 matrix.</summary> 708 /// <param name="v">Value to transpose.</param> 709 /// <returns>Transposed value.</returns> 710 [MethodImpl(MethodImplOptions.AggressiveInlining)] 711 public static int3x3 transpose(int3x3 v) 712 { 713 return int3x3( 714 v.c0.x, v.c0.y, v.c0.z, 715 v.c1.x, v.c1.y, v.c1.z, 716 v.c2.x, v.c2.y, v.c2.z); 717 } 718 719 /// <summary>Returns the determinant of a int3x3 matrix.</summary> 720 /// <param name="m">Matrix to use when computing determinant.</param> 721 /// <returns>The determinant of the matrix.</returns> 722 [MethodImpl(MethodImplOptions.AggressiveInlining)] 723 public static int determinant(int3x3 m) 724 { 725 int3 c0 = m.c0; 726 int3 c1 = m.c1; 727 int3 c2 = m.c2; 728 729 int m00 = c1.y * c2.z - c1.z * c2.y; 730 int m01 = c0.y * c2.z - c0.z * c2.y; 731 int m02 = c0.y * c1.z - c0.z * c1.y; 732 733 return c0.x * m00 - c1.x * m01 + c2.x * m02; 734 } 735 736 /// <summary>Returns a uint hash code of a int3x3 matrix.</summary> 737 /// <param name="v">Matrix value to hash.</param> 738 /// <returns>uint hash of the argument.</returns> 739 [MethodImpl(MethodImplOptions.AggressiveInlining)] 740 public static uint hash(int3x3 v) 741 { 742 return csum(asuint(v.c0) * uint3(0x93C30C2Bu, 0xDCAF0351u, 0x6E050B01u) + 743 asuint(v.c1) * uint3(0x750FDBF5u, 0x7F3DD499u, 0x52EAAEBBu) + 744 asuint(v.c2) * uint3(0x4599C793u, 0x83B5E729u, 0xC267163Fu)) + 0x67BC9149u; 745 } 746 747 /// <summary> 748 /// Returns a uint3 vector hash code of a int3x3 matrix. 749 /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash 750 /// that are only reduced to a narrow uint hash at the very end instead of at every step. 751 /// </summary> 752 /// <param name="v">Matrix value to hash.</param> 753 /// <returns>uint3 hash of the argument.</returns> 754 [MethodImpl(MethodImplOptions.AggressiveInlining)] 755 public static uint3 hashwide(int3x3 v) 756 { 757 return (asuint(v.c0) * uint3(0xAD7C5EC1u, 0x822A7D6Du, 0xB492BF15u) + 758 asuint(v.c1) * uint3(0xD37220E3u, 0x7AA2C2BDu, 0xE16BC89Du) + 759 asuint(v.c2) * uint3(0x7AA07CD3u, 0xAF642BA9u, 0xA8F2213Bu)) + 0x9F3FDC37u; 760 } 761 762 } 763}