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 System.Diagnostics; 12using Unity.IL2CPP.CompilerServices; 13 14#pragma warning disable 0660, 0661 15 16namespace Unity.Mathematics 17{ 18 /// <summary>A 2 component vector of uints.</summary> 19 [DebuggerTypeProxy(typeof(uint2.DebuggerProxy))] 20 [System.Serializable] 21 [Il2CppEagerStaticClassConstruction] 22 public partial struct uint2 : System.IEquatable<uint2>, IFormattable 23 { 24 /// <summary>x component of the vector.</summary> 25 public uint x; 26 /// <summary>y component of the vector.</summary> 27 public uint y; 28 29 /// <summary>uint2 zero value.</summary> 30 public static readonly uint2 zero; 31 32 /// <summary>Constructs a uint2 vector from two uint values.</summary> 33 /// <param name="x">The constructed vector's x component will be set to this value.</param> 34 /// <param name="y">The constructed vector's y component will be set to this value.</param> 35 [MethodImpl(MethodImplOptions.AggressiveInlining)] 36 public uint2(uint x, uint y) 37 { 38 this.x = x; 39 this.y = y; 40 } 41 42 /// <summary>Constructs a uint2 vector from a uint2 vector.</summary> 43 /// <param name="xy">The constructed vector's xy components will be set to this value.</param> 44 [MethodImpl(MethodImplOptions.AggressiveInlining)] 45 public uint2(uint2 xy) 46 { 47 this.x = xy.x; 48 this.y = xy.y; 49 } 50 51 /// <summary>Constructs a uint2 vector from a single uint value by assigning it to every component.</summary> 52 /// <param name="v">uint to convert to uint2</param> 53 [MethodImpl(MethodImplOptions.AggressiveInlining)] 54 public uint2(uint v) 55 { 56 this.x = v; 57 this.y = v; 58 } 59 60 /// <summary>Constructs a uint2 vector from a single bool value by converting it to uint and assigning it to every component.</summary> 61 /// <param name="v">bool to convert to uint2</param> 62 [MethodImpl(MethodImplOptions.AggressiveInlining)] 63 public uint2(bool v) 64 { 65 this.x = v ? 1u : 0u; 66 this.y = v ? 1u : 0u; 67 } 68 69 /// <summary>Constructs a uint2 vector from a bool2 vector by componentwise conversion.</summary> 70 /// <param name="v">bool2 to convert to uint2</param> 71 [MethodImpl(MethodImplOptions.AggressiveInlining)] 72 public uint2(bool2 v) 73 { 74 this.x = v.x ? 1u : 0u; 75 this.y = v.y ? 1u : 0u; 76 } 77 78 /// <summary>Constructs a uint2 vector from a single int value by converting it to uint and assigning it to every component.</summary> 79 /// <param name="v">int to convert to uint2</param> 80 [MethodImpl(MethodImplOptions.AggressiveInlining)] 81 public uint2(int v) 82 { 83 this.x = (uint)v; 84 this.y = (uint)v; 85 } 86 87 /// <summary>Constructs a uint2 vector from a int2 vector by componentwise conversion.</summary> 88 /// <param name="v">int2 to convert to uint2</param> 89 [MethodImpl(MethodImplOptions.AggressiveInlining)] 90 public uint2(int2 v) 91 { 92 this.x = (uint)v.x; 93 this.y = (uint)v.y; 94 } 95 96 /// <summary>Constructs a uint2 vector from a single float value by converting it to uint and assigning it to every component.</summary> 97 /// <param name="v">float to convert to uint2</param> 98 [MethodImpl(MethodImplOptions.AggressiveInlining)] 99 public uint2(float v) 100 { 101 this.x = (uint)v; 102 this.y = (uint)v; 103 } 104 105 /// <summary>Constructs a uint2 vector from a float2 vector by componentwise conversion.</summary> 106 /// <param name="v">float2 to convert to uint2</param> 107 [MethodImpl(MethodImplOptions.AggressiveInlining)] 108 public uint2(float2 v) 109 { 110 this.x = (uint)v.x; 111 this.y = (uint)v.y; 112 } 113 114 /// <summary>Constructs a uint2 vector from a single double value by converting it to uint and assigning it to every component.</summary> 115 /// <param name="v">double to convert to uint2</param> 116 [MethodImpl(MethodImplOptions.AggressiveInlining)] 117 public uint2(double v) 118 { 119 this.x = (uint)v; 120 this.y = (uint)v; 121 } 122 123 /// <summary>Constructs a uint2 vector from a double2 vector by componentwise conversion.</summary> 124 /// <param name="v">double2 to convert to uint2</param> 125 [MethodImpl(MethodImplOptions.AggressiveInlining)] 126 public uint2(double2 v) 127 { 128 this.x = (uint)v.x; 129 this.y = (uint)v.y; 130 } 131 132 133 /// <summary>Implicitly converts a single uint value to a uint2 vector by assigning it to every component.</summary> 134 /// <param name="v">uint to convert to uint2</param> 135 /// <returns>Converted value.</returns> 136 [MethodImpl(MethodImplOptions.AggressiveInlining)] 137 public static implicit operator uint2(uint v) { return new uint2(v); } 138 139 /// <summary>Explicitly converts a single bool value to a uint2 vector by converting it to uint and assigning it to every component.</summary> 140 /// <param name="v">bool to convert to uint2</param> 141 /// <returns>Converted value.</returns> 142 [MethodImpl(MethodImplOptions.AggressiveInlining)] 143 public static explicit operator uint2(bool v) { return new uint2(v); } 144 145 /// <summary>Explicitly converts a bool2 vector to a uint2 vector by componentwise conversion.</summary> 146 /// <param name="v">bool2 to convert to uint2</param> 147 /// <returns>Converted value.</returns> 148 [MethodImpl(MethodImplOptions.AggressiveInlining)] 149 public static explicit operator uint2(bool2 v) { return new uint2(v); } 150 151 /// <summary>Explicitly converts a single int value to a uint2 vector by converting it to uint and assigning it to every component.</summary> 152 /// <param name="v">int to convert to uint2</param> 153 /// <returns>Converted value.</returns> 154 [MethodImpl(MethodImplOptions.AggressiveInlining)] 155 public static explicit operator uint2(int v) { return new uint2(v); } 156 157 /// <summary>Explicitly converts a int2 vector to a uint2 vector by componentwise conversion.</summary> 158 /// <param name="v">int2 to convert to uint2</param> 159 /// <returns>Converted value.</returns> 160 [MethodImpl(MethodImplOptions.AggressiveInlining)] 161 public static explicit operator uint2(int2 v) { return new uint2(v); } 162 163 /// <summary>Explicitly converts a single float value to a uint2 vector by converting it to uint and assigning it to every component.</summary> 164 /// <param name="v">float to convert to uint2</param> 165 /// <returns>Converted value.</returns> 166 [MethodImpl(MethodImplOptions.AggressiveInlining)] 167 public static explicit operator uint2(float v) { return new uint2(v); } 168 169 /// <summary>Explicitly converts a float2 vector to a uint2 vector by componentwise conversion.</summary> 170 /// <param name="v">float2 to convert to uint2</param> 171 /// <returns>Converted value.</returns> 172 [MethodImpl(MethodImplOptions.AggressiveInlining)] 173 public static explicit operator uint2(float2 v) { return new uint2(v); } 174 175 /// <summary>Explicitly converts a single double value to a uint2 vector by converting it to uint and assigning it to every component.</summary> 176 /// <param name="v">double to convert to uint2</param> 177 /// <returns>Converted value.</returns> 178 [MethodImpl(MethodImplOptions.AggressiveInlining)] 179 public static explicit operator uint2(double v) { return new uint2(v); } 180 181 /// <summary>Explicitly converts a double2 vector to a uint2 vector by componentwise conversion.</summary> 182 /// <param name="v">double2 to convert to uint2</param> 183 /// <returns>Converted value.</returns> 184 [MethodImpl(MethodImplOptions.AggressiveInlining)] 185 public static explicit operator uint2(double2 v) { return new uint2(v); } 186 187 188 /// <summary>Returns the result of a componentwise multiplication operation on two uint2 vectors.</summary> 189 /// <param name="lhs">Left hand side uint2 to use to compute componentwise multiplication.</param> 190 /// <param name="rhs">Right hand side uint2 to use to compute componentwise multiplication.</param> 191 /// <returns>uint2 result of the componentwise multiplication.</returns> 192 [MethodImpl(MethodImplOptions.AggressiveInlining)] 193 public static uint2 operator * (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x * rhs.x, lhs.y * rhs.y); } 194 195 /// <summary>Returns the result of a componentwise multiplication operation on a uint2 vector and a uint value.</summary> 196 /// <param name="lhs">Left hand side uint2 to use to compute componentwise multiplication.</param> 197 /// <param name="rhs">Right hand side uint to use to compute componentwise multiplication.</param> 198 /// <returns>uint2 result of the componentwise multiplication.</returns> 199 [MethodImpl(MethodImplOptions.AggressiveInlining)] 200 public static uint2 operator * (uint2 lhs, uint rhs) { return new uint2 (lhs.x * rhs, lhs.y * rhs); } 201 202 /// <summary>Returns the result of a componentwise multiplication operation on a uint value and a uint2 vector.</summary> 203 /// <param name="lhs">Left hand side uint to use to compute componentwise multiplication.</param> 204 /// <param name="rhs">Right hand side uint2 to use to compute componentwise multiplication.</param> 205 /// <returns>uint2 result of the componentwise multiplication.</returns> 206 [MethodImpl(MethodImplOptions.AggressiveInlining)] 207 public static uint2 operator * (uint lhs, uint2 rhs) { return new uint2 (lhs * rhs.x, lhs * rhs.y); } 208 209 210 /// <summary>Returns the result of a componentwise addition operation on two uint2 vectors.</summary> 211 /// <param name="lhs">Left hand side uint2 to use to compute componentwise addition.</param> 212 /// <param name="rhs">Right hand side uint2 to use to compute componentwise addition.</param> 213 /// <returns>uint2 result of the componentwise addition.</returns> 214 [MethodImpl(MethodImplOptions.AggressiveInlining)] 215 public static uint2 operator + (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x + rhs.x, lhs.y + rhs.y); } 216 217 /// <summary>Returns the result of a componentwise addition operation on a uint2 vector and a uint value.</summary> 218 /// <param name="lhs">Left hand side uint2 to use to compute componentwise addition.</param> 219 /// <param name="rhs">Right hand side uint to use to compute componentwise addition.</param> 220 /// <returns>uint2 result of the componentwise addition.</returns> 221 [MethodImpl(MethodImplOptions.AggressiveInlining)] 222 public static uint2 operator + (uint2 lhs, uint rhs) { return new uint2 (lhs.x + rhs, lhs.y + rhs); } 223 224 /// <summary>Returns the result of a componentwise addition operation on a uint value and a uint2 vector.</summary> 225 /// <param name="lhs">Left hand side uint to use to compute componentwise addition.</param> 226 /// <param name="rhs">Right hand side uint2 to use to compute componentwise addition.</param> 227 /// <returns>uint2 result of the componentwise addition.</returns> 228 [MethodImpl(MethodImplOptions.AggressiveInlining)] 229 public static uint2 operator + (uint lhs, uint2 rhs) { return new uint2 (lhs + rhs.x, lhs + rhs.y); } 230 231 232 /// <summary>Returns the result of a componentwise subtraction operation on two uint2 vectors.</summary> 233 /// <param name="lhs">Left hand side uint2 to use to compute componentwise subtraction.</param> 234 /// <param name="rhs">Right hand side uint2 to use to compute componentwise subtraction.</param> 235 /// <returns>uint2 result of the componentwise subtraction.</returns> 236 [MethodImpl(MethodImplOptions.AggressiveInlining)] 237 public static uint2 operator - (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x - rhs.x, lhs.y - rhs.y); } 238 239 /// <summary>Returns the result of a componentwise subtraction operation on a uint2 vector and a uint value.</summary> 240 /// <param name="lhs">Left hand side uint2 to use to compute componentwise subtraction.</param> 241 /// <param name="rhs">Right hand side uint to use to compute componentwise subtraction.</param> 242 /// <returns>uint2 result of the componentwise subtraction.</returns> 243 [MethodImpl(MethodImplOptions.AggressiveInlining)] 244 public static uint2 operator - (uint2 lhs, uint rhs) { return new uint2 (lhs.x - rhs, lhs.y - rhs); } 245 246 /// <summary>Returns the result of a componentwise subtraction operation on a uint value and a uint2 vector.</summary> 247 /// <param name="lhs">Left hand side uint to use to compute componentwise subtraction.</param> 248 /// <param name="rhs">Right hand side uint2 to use to compute componentwise subtraction.</param> 249 /// <returns>uint2 result of the componentwise subtraction.</returns> 250 [MethodImpl(MethodImplOptions.AggressiveInlining)] 251 public static uint2 operator - (uint lhs, uint2 rhs) { return new uint2 (lhs - rhs.x, lhs - rhs.y); } 252 253 254 /// <summary>Returns the result of a componentwise division operation on two uint2 vectors.</summary> 255 /// <param name="lhs">Left hand side uint2 to use to compute componentwise division.</param> 256 /// <param name="rhs">Right hand side uint2 to use to compute componentwise division.</param> 257 /// <returns>uint2 result of the componentwise division.</returns> 258 [MethodImpl(MethodImplOptions.AggressiveInlining)] 259 public static uint2 operator / (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x / rhs.x, lhs.y / rhs.y); } 260 261 /// <summary>Returns the result of a componentwise division operation on a uint2 vector and a uint value.</summary> 262 /// <param name="lhs">Left hand side uint2 to use to compute componentwise division.</param> 263 /// <param name="rhs">Right hand side uint to use to compute componentwise division.</param> 264 /// <returns>uint2 result of the componentwise division.</returns> 265 [MethodImpl(MethodImplOptions.AggressiveInlining)] 266 public static uint2 operator / (uint2 lhs, uint rhs) { return new uint2 (lhs.x / rhs, lhs.y / rhs); } 267 268 /// <summary>Returns the result of a componentwise division operation on a uint value and a uint2 vector.</summary> 269 /// <param name="lhs">Left hand side uint to use to compute componentwise division.</param> 270 /// <param name="rhs">Right hand side uint2 to use to compute componentwise division.</param> 271 /// <returns>uint2 result of the componentwise division.</returns> 272 [MethodImpl(MethodImplOptions.AggressiveInlining)] 273 public static uint2 operator / (uint lhs, uint2 rhs) { return new uint2 (lhs / rhs.x, lhs / rhs.y); } 274 275 276 /// <summary>Returns the result of a componentwise modulus operation on two uint2 vectors.</summary> 277 /// <param name="lhs">Left hand side uint2 to use to compute componentwise modulus.</param> 278 /// <param name="rhs">Right hand side uint2 to use to compute componentwise modulus.</param> 279 /// <returns>uint2 result of the componentwise modulus.</returns> 280 [MethodImpl(MethodImplOptions.AggressiveInlining)] 281 public static uint2 operator % (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x % rhs.x, lhs.y % rhs.y); } 282 283 /// <summary>Returns the result of a componentwise modulus operation on a uint2 vector and a uint value.</summary> 284 /// <param name="lhs">Left hand side uint2 to use to compute componentwise modulus.</param> 285 /// <param name="rhs">Right hand side uint to use to compute componentwise modulus.</param> 286 /// <returns>uint2 result of the componentwise modulus.</returns> 287 [MethodImpl(MethodImplOptions.AggressiveInlining)] 288 public static uint2 operator % (uint2 lhs, uint rhs) { return new uint2 (lhs.x % rhs, lhs.y % rhs); } 289 290 /// <summary>Returns the result of a componentwise modulus operation on a uint value and a uint2 vector.</summary> 291 /// <param name="lhs">Left hand side uint to use to compute componentwise modulus.</param> 292 /// <param name="rhs">Right hand side uint2 to use to compute componentwise modulus.</param> 293 /// <returns>uint2 result of the componentwise modulus.</returns> 294 [MethodImpl(MethodImplOptions.AggressiveInlining)] 295 public static uint2 operator % (uint lhs, uint2 rhs) { return new uint2 (lhs % rhs.x, lhs % rhs.y); } 296 297 298 /// <summary>Returns the result of a componentwise increment operation on a uint2 vector.</summary> 299 /// <param name="val">Value to use when computing the componentwise increment.</param> 300 /// <returns>uint2 result of the componentwise increment.</returns> 301 [MethodImpl(MethodImplOptions.AggressiveInlining)] 302 public static uint2 operator ++ (uint2 val) { return new uint2 (++val.x, ++val.y); } 303 304 305 /// <summary>Returns the result of a componentwise decrement operation on a uint2 vector.</summary> 306 /// <param name="val">Value to use when computing the componentwise decrement.</param> 307 /// <returns>uint2 result of the componentwise decrement.</returns> 308 [MethodImpl(MethodImplOptions.AggressiveInlining)] 309 public static uint2 operator -- (uint2 val) { return new uint2 (--val.x, --val.y); } 310 311 312 /// <summary>Returns the result of a componentwise less than operation on two uint2 vectors.</summary> 313 /// <param name="lhs">Left hand side uint2 to use to compute componentwise less than.</param> 314 /// <param name="rhs">Right hand side uint2 to use to compute componentwise less than.</param> 315 /// <returns>bool2 result of the componentwise less than.</returns> 316 [MethodImpl(MethodImplOptions.AggressiveInlining)] 317 public static bool2 operator < (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x < rhs.x, lhs.y < rhs.y); } 318 319 /// <summary>Returns the result of a componentwise less than operation on a uint2 vector and a uint value.</summary> 320 /// <param name="lhs">Left hand side uint2 to use to compute componentwise less than.</param> 321 /// <param name="rhs">Right hand side uint to use to compute componentwise less than.</param> 322 /// <returns>bool2 result of the componentwise less than.</returns> 323 [MethodImpl(MethodImplOptions.AggressiveInlining)] 324 public static bool2 operator < (uint2 lhs, uint rhs) { return new bool2 (lhs.x < rhs, lhs.y < rhs); } 325 326 /// <summary>Returns the result of a componentwise less than operation on a uint value and a uint2 vector.</summary> 327 /// <param name="lhs">Left hand side uint to use to compute componentwise less than.</param> 328 /// <param name="rhs">Right hand side uint2 to use to compute componentwise less than.</param> 329 /// <returns>bool2 result of the componentwise less than.</returns> 330 [MethodImpl(MethodImplOptions.AggressiveInlining)] 331 public static bool2 operator < (uint lhs, uint2 rhs) { return new bool2 (lhs < rhs.x, lhs < rhs.y); } 332 333 334 /// <summary>Returns the result of a componentwise less or equal operation on two uint2 vectors.</summary> 335 /// <param name="lhs">Left hand side uint2 to use to compute componentwise less or equal.</param> 336 /// <param name="rhs">Right hand side uint2 to use to compute componentwise less or equal.</param> 337 /// <returns>bool2 result of the componentwise less or equal.</returns> 338 [MethodImpl(MethodImplOptions.AggressiveInlining)] 339 public static bool2 operator <= (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x <= rhs.x, lhs.y <= rhs.y); } 340 341 /// <summary>Returns the result of a componentwise less or equal operation on a uint2 vector and a uint value.</summary> 342 /// <param name="lhs">Left hand side uint2 to use to compute componentwise less or equal.</param> 343 /// <param name="rhs">Right hand side uint to use to compute componentwise less or equal.</param> 344 /// <returns>bool2 result of the componentwise less or equal.</returns> 345 [MethodImpl(MethodImplOptions.AggressiveInlining)] 346 public static bool2 operator <= (uint2 lhs, uint rhs) { return new bool2 (lhs.x <= rhs, lhs.y <= rhs); } 347 348 /// <summary>Returns the result of a componentwise less or equal operation on a uint value and a uint2 vector.</summary> 349 /// <param name="lhs">Left hand side uint to use to compute componentwise less or equal.</param> 350 /// <param name="rhs">Right hand side uint2 to use to compute componentwise less or equal.</param> 351 /// <returns>bool2 result of the componentwise less or equal.</returns> 352 [MethodImpl(MethodImplOptions.AggressiveInlining)] 353 public static bool2 operator <= (uint lhs, uint2 rhs) { return new bool2 (lhs <= rhs.x, lhs <= rhs.y); } 354 355 356 /// <summary>Returns the result of a componentwise greater than operation on two uint2 vectors.</summary> 357 /// <param name="lhs">Left hand side uint2 to use to compute componentwise greater than.</param> 358 /// <param name="rhs">Right hand side uint2 to use to compute componentwise greater than.</param> 359 /// <returns>bool2 result of the componentwise greater than.</returns> 360 [MethodImpl(MethodImplOptions.AggressiveInlining)] 361 public static bool2 operator > (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x > rhs.x, lhs.y > rhs.y); } 362 363 /// <summary>Returns the result of a componentwise greater than operation on a uint2 vector and a uint value.</summary> 364 /// <param name="lhs">Left hand side uint2 to use to compute componentwise greater than.</param> 365 /// <param name="rhs">Right hand side uint to use to compute componentwise greater than.</param> 366 /// <returns>bool2 result of the componentwise greater than.</returns> 367 [MethodImpl(MethodImplOptions.AggressiveInlining)] 368 public static bool2 operator > (uint2 lhs, uint rhs) { return new bool2 (lhs.x > rhs, lhs.y > rhs); } 369 370 /// <summary>Returns the result of a componentwise greater than operation on a uint value and a uint2 vector.</summary> 371 /// <param name="lhs">Left hand side uint to use to compute componentwise greater than.</param> 372 /// <param name="rhs">Right hand side uint2 to use to compute componentwise greater than.</param> 373 /// <returns>bool2 result of the componentwise greater than.</returns> 374 [MethodImpl(MethodImplOptions.AggressiveInlining)] 375 public static bool2 operator > (uint lhs, uint2 rhs) { return new bool2 (lhs > rhs.x, lhs > rhs.y); } 376 377 378 /// <summary>Returns the result of a componentwise greater or equal operation on two uint2 vectors.</summary> 379 /// <param name="lhs">Left hand side uint2 to use to compute componentwise greater or equal.</param> 380 /// <param name="rhs">Right hand side uint2 to use to compute componentwise greater or equal.</param> 381 /// <returns>bool2 result of the componentwise greater or equal.</returns> 382 [MethodImpl(MethodImplOptions.AggressiveInlining)] 383 public static bool2 operator >= (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x >= rhs.x, lhs.y >= rhs.y); } 384 385 /// <summary>Returns the result of a componentwise greater or equal operation on a uint2 vector and a uint value.</summary> 386 /// <param name="lhs">Left hand side uint2 to use to compute componentwise greater or equal.</param> 387 /// <param name="rhs">Right hand side uint to use to compute componentwise greater or equal.</param> 388 /// <returns>bool2 result of the componentwise greater or equal.</returns> 389 [MethodImpl(MethodImplOptions.AggressiveInlining)] 390 public static bool2 operator >= (uint2 lhs, uint rhs) { return new bool2 (lhs.x >= rhs, lhs.y >= rhs); } 391 392 /// <summary>Returns the result of a componentwise greater or equal operation on a uint value and a uint2 vector.</summary> 393 /// <param name="lhs">Left hand side uint to use to compute componentwise greater or equal.</param> 394 /// <param name="rhs">Right hand side uint2 to use to compute componentwise greater or equal.</param> 395 /// <returns>bool2 result of the componentwise greater or equal.</returns> 396 [MethodImpl(MethodImplOptions.AggressiveInlining)] 397 public static bool2 operator >= (uint lhs, uint2 rhs) { return new bool2 (lhs >= rhs.x, lhs >= rhs.y); } 398 399 400 /// <summary>Returns the result of a componentwise unary minus operation on a uint2 vector.</summary> 401 /// <param name="val">Value to use when computing the componentwise unary minus.</param> 402 /// <returns>uint2 result of the componentwise unary minus.</returns> 403 [MethodImpl(MethodImplOptions.AggressiveInlining)] 404 public static uint2 operator - (uint2 val) { return new uint2 ((uint)-val.x, (uint)-val.y); } 405 406 407 /// <summary>Returns the result of a componentwise unary plus operation on a uint2 vector.</summary> 408 /// <param name="val">Value to use when computing the componentwise unary plus.</param> 409 /// <returns>uint2 result of the componentwise unary plus.</returns> 410 [MethodImpl(MethodImplOptions.AggressiveInlining)] 411 public static uint2 operator + (uint2 val) { return new uint2 (+val.x, +val.y); } 412 413 414 /// <summary>Returns the result of a componentwise left shift operation on a uint2 vector by a number of bits specified by a single int.</summary> 415 /// <param name="x">The vector to left shift.</param> 416 /// <param name="n">The number of bits to left shift.</param> 417 /// <returns>The result of the componentwise left shift.</returns> 418 [MethodImpl(MethodImplOptions.AggressiveInlining)] 419 public static uint2 operator << (uint2 x, int n) { return new uint2 (x.x << n, x.y << n); } 420 421 /// <summary>Returns the result of a componentwise right shift operation on a uint2 vector by a number of bits specified by a single int.</summary> 422 /// <param name="x">The vector to right shift.</param> 423 /// <param name="n">The number of bits to right shift.</param> 424 /// <returns>The result of the componentwise right shift.</returns> 425 [MethodImpl(MethodImplOptions.AggressiveInlining)] 426 public static uint2 operator >> (uint2 x, int n) { return new uint2 (x.x >> n, x.y >> n); } 427 428 /// <summary>Returns the result of a componentwise equality operation on two uint2 vectors.</summary> 429 /// <param name="lhs">Left hand side uint2 to use to compute componentwise equality.</param> 430 /// <param name="rhs">Right hand side uint2 to use to compute componentwise equality.</param> 431 /// <returns>bool2 result of the componentwise equality.</returns> 432 [MethodImpl(MethodImplOptions.AggressiveInlining)] 433 public static bool2 operator == (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); } 434 435 /// <summary>Returns the result of a componentwise equality operation on a uint2 vector and a uint value.</summary> 436 /// <param name="lhs">Left hand side uint2 to use to compute componentwise equality.</param> 437 /// <param name="rhs">Right hand side uint to use to compute componentwise equality.</param> 438 /// <returns>bool2 result of the componentwise equality.</returns> 439 [MethodImpl(MethodImplOptions.AggressiveInlining)] 440 public static bool2 operator == (uint2 lhs, uint rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); } 441 442 /// <summary>Returns the result of a componentwise equality operation on a uint value and a uint2 vector.</summary> 443 /// <param name="lhs">Left hand side uint to use to compute componentwise equality.</param> 444 /// <param name="rhs">Right hand side uint2 to use to compute componentwise equality.</param> 445 /// <returns>bool2 result of the componentwise equality.</returns> 446 [MethodImpl(MethodImplOptions.AggressiveInlining)] 447 public static bool2 operator == (uint lhs, uint2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); } 448 449 450 /// <summary>Returns the result of a componentwise not equal operation on two uint2 vectors.</summary> 451 /// <param name="lhs">Left hand side uint2 to use to compute componentwise not equal.</param> 452 /// <param name="rhs">Right hand side uint2 to use to compute componentwise not equal.</param> 453 /// <returns>bool2 result of the componentwise not equal.</returns> 454 [MethodImpl(MethodImplOptions.AggressiveInlining)] 455 public static bool2 operator != (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); } 456 457 /// <summary>Returns the result of a componentwise not equal operation on a uint2 vector and a uint value.</summary> 458 /// <param name="lhs">Left hand side uint2 to use to compute componentwise not equal.</param> 459 /// <param name="rhs">Right hand side uint to use to compute componentwise not equal.</param> 460 /// <returns>bool2 result of the componentwise not equal.</returns> 461 [MethodImpl(MethodImplOptions.AggressiveInlining)] 462 public static bool2 operator != (uint2 lhs, uint rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); } 463 464 /// <summary>Returns the result of a componentwise not equal operation on a uint value and a uint2 vector.</summary> 465 /// <param name="lhs">Left hand side uint to use to compute componentwise not equal.</param> 466 /// <param name="rhs">Right hand side uint2 to use to compute componentwise not equal.</param> 467 /// <returns>bool2 result of the componentwise not equal.</returns> 468 [MethodImpl(MethodImplOptions.AggressiveInlining)] 469 public static bool2 operator != (uint lhs, uint2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); } 470 471 472 /// <summary>Returns the result of a componentwise bitwise not operation on a uint2 vector.</summary> 473 /// <param name="val">Value to use when computing the componentwise bitwise not.</param> 474 /// <returns>uint2 result of the componentwise bitwise not.</returns> 475 [MethodImpl(MethodImplOptions.AggressiveInlining)] 476 public static uint2 operator ~ (uint2 val) { return new uint2 (~val.x, ~val.y); } 477 478 479 /// <summary>Returns the result of a componentwise bitwise and operation on two uint2 vectors.</summary> 480 /// <param name="lhs">Left hand side uint2 to use to compute componentwise bitwise and.</param> 481 /// <param name="rhs">Right hand side uint2 to use to compute componentwise bitwise and.</param> 482 /// <returns>uint2 result of the componentwise bitwise and.</returns> 483 [MethodImpl(MethodImplOptions.AggressiveInlining)] 484 public static uint2 operator & (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x & rhs.x, lhs.y & rhs.y); } 485 486 /// <summary>Returns the result of a componentwise bitwise and operation on a uint2 vector and a uint value.</summary> 487 /// <param name="lhs">Left hand side uint2 to use to compute componentwise bitwise and.</param> 488 /// <param name="rhs">Right hand side uint to use to compute componentwise bitwise and.</param> 489 /// <returns>uint2 result of the componentwise bitwise and.</returns> 490 [MethodImpl(MethodImplOptions.AggressiveInlining)] 491 public static uint2 operator & (uint2 lhs, uint rhs) { return new uint2 (lhs.x & rhs, lhs.y & rhs); } 492 493 /// <summary>Returns the result of a componentwise bitwise and operation on a uint value and a uint2 vector.</summary> 494 /// <param name="lhs">Left hand side uint to use to compute componentwise bitwise and.</param> 495 /// <param name="rhs">Right hand side uint2 to use to compute componentwise bitwise and.</param> 496 /// <returns>uint2 result of the componentwise bitwise and.</returns> 497 [MethodImpl(MethodImplOptions.AggressiveInlining)] 498 public static uint2 operator & (uint lhs, uint2 rhs) { return new uint2 (lhs & rhs.x, lhs & rhs.y); } 499 500 501 /// <summary>Returns the result of a componentwise bitwise or operation on two uint2 vectors.</summary> 502 /// <param name="lhs">Left hand side uint2 to use to compute componentwise bitwise or.</param> 503 /// <param name="rhs">Right hand side uint2 to use to compute componentwise bitwise or.</param> 504 /// <returns>uint2 result of the componentwise bitwise or.</returns> 505 [MethodImpl(MethodImplOptions.AggressiveInlining)] 506 public static uint2 operator | (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x | rhs.x, lhs.y | rhs.y); } 507 508 /// <summary>Returns the result of a componentwise bitwise or operation on a uint2 vector and a uint value.</summary> 509 /// <param name="lhs">Left hand side uint2 to use to compute componentwise bitwise or.</param> 510 /// <param name="rhs">Right hand side uint to use to compute componentwise bitwise or.</param> 511 /// <returns>uint2 result of the componentwise bitwise or.</returns> 512 [MethodImpl(MethodImplOptions.AggressiveInlining)] 513 public static uint2 operator | (uint2 lhs, uint rhs) { return new uint2 (lhs.x | rhs, lhs.y | rhs); } 514 515 /// <summary>Returns the result of a componentwise bitwise or operation on a uint value and a uint2 vector.</summary> 516 /// <param name="lhs">Left hand side uint to use to compute componentwise bitwise or.</param> 517 /// <param name="rhs">Right hand side uint2 to use to compute componentwise bitwise or.</param> 518 /// <returns>uint2 result of the componentwise bitwise or.</returns> 519 [MethodImpl(MethodImplOptions.AggressiveInlining)] 520 public static uint2 operator | (uint lhs, uint2 rhs) { return new uint2 (lhs | rhs.x, lhs | rhs.y); } 521 522 523 /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two uint2 vectors.</summary> 524 /// <param name="lhs">Left hand side uint2 to use to compute componentwise bitwise exclusive or.</param> 525 /// <param name="rhs">Right hand side uint2 to use to compute componentwise bitwise exclusive or.</param> 526 /// <returns>uint2 result of the componentwise bitwise exclusive or.</returns> 527 [MethodImpl(MethodImplOptions.AggressiveInlining)] 528 public static uint2 operator ^ (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x ^ rhs.x, lhs.y ^ rhs.y); } 529 530 /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a uint2 vector and a uint value.</summary> 531 /// <param name="lhs">Left hand side uint2 to use to compute componentwise bitwise exclusive or.</param> 532 /// <param name="rhs">Right hand side uint to use to compute componentwise bitwise exclusive or.</param> 533 /// <returns>uint2 result of the componentwise bitwise exclusive or.</returns> 534 [MethodImpl(MethodImplOptions.AggressiveInlining)] 535 public static uint2 operator ^ (uint2 lhs, uint rhs) { return new uint2 (lhs.x ^ rhs, lhs.y ^ rhs); } 536 537 /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint2 vector.</summary> 538 /// <param name="lhs">Left hand side uint to use to compute componentwise bitwise exclusive or.</param> 539 /// <param name="rhs">Right hand side uint2 to use to compute componentwise bitwise exclusive or.</param> 540 /// <returns>uint2 result of the componentwise bitwise exclusive or.</returns> 541 [MethodImpl(MethodImplOptions.AggressiveInlining)] 542 public static uint2 operator ^ (uint lhs, uint2 rhs) { return new uint2 (lhs ^ rhs.x, lhs ^ rhs.y); } 543 544 545 546 547 /// <summary>Swizzles the vector.</summary> 548 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 549 public uint4 xxxx 550 { 551 [MethodImpl(MethodImplOptions.AggressiveInlining)] 552 get { return new uint4(x, x, x, x); } 553 } 554 555 556 /// <summary>Swizzles the vector.</summary> 557 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 558 public uint4 xxxy 559 { 560 [MethodImpl(MethodImplOptions.AggressiveInlining)] 561 get { return new uint4(x, x, x, y); } 562 } 563 564 565 /// <summary>Swizzles the vector.</summary> 566 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 567 public uint4 xxyx 568 { 569 [MethodImpl(MethodImplOptions.AggressiveInlining)] 570 get { return new uint4(x, x, y, x); } 571 } 572 573 574 /// <summary>Swizzles the vector.</summary> 575 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 576 public uint4 xxyy 577 { 578 [MethodImpl(MethodImplOptions.AggressiveInlining)] 579 get { return new uint4(x, x, y, y); } 580 } 581 582 583 /// <summary>Swizzles the vector.</summary> 584 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 585 public uint4 xyxx 586 { 587 [MethodImpl(MethodImplOptions.AggressiveInlining)] 588 get { return new uint4(x, y, x, x); } 589 } 590 591 592 /// <summary>Swizzles the vector.</summary> 593 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 594 public uint4 xyxy 595 { 596 [MethodImpl(MethodImplOptions.AggressiveInlining)] 597 get { return new uint4(x, y, x, y); } 598 } 599 600 601 /// <summary>Swizzles the vector.</summary> 602 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 603 public uint4 xyyx 604 { 605 [MethodImpl(MethodImplOptions.AggressiveInlining)] 606 get { return new uint4(x, y, y, x); } 607 } 608 609 610 /// <summary>Swizzles the vector.</summary> 611 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 612 public uint4 xyyy 613 { 614 [MethodImpl(MethodImplOptions.AggressiveInlining)] 615 get { return new uint4(x, y, y, y); } 616 } 617 618 619 /// <summary>Swizzles the vector.</summary> 620 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 621 public uint4 yxxx 622 { 623 [MethodImpl(MethodImplOptions.AggressiveInlining)] 624 get { return new uint4(y, x, x, x); } 625 } 626 627 628 /// <summary>Swizzles the vector.</summary> 629 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 630 public uint4 yxxy 631 { 632 [MethodImpl(MethodImplOptions.AggressiveInlining)] 633 get { return new uint4(y, x, x, y); } 634 } 635 636 637 /// <summary>Swizzles the vector.</summary> 638 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 639 public uint4 yxyx 640 { 641 [MethodImpl(MethodImplOptions.AggressiveInlining)] 642 get { return new uint4(y, x, y, x); } 643 } 644 645 646 /// <summary>Swizzles the vector.</summary> 647 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 648 public uint4 yxyy 649 { 650 [MethodImpl(MethodImplOptions.AggressiveInlining)] 651 get { return new uint4(y, x, y, y); } 652 } 653 654 655 /// <summary>Swizzles the vector.</summary> 656 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 657 public uint4 yyxx 658 { 659 [MethodImpl(MethodImplOptions.AggressiveInlining)] 660 get { return new uint4(y, y, x, x); } 661 } 662 663 664 /// <summary>Swizzles the vector.</summary> 665 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 666 public uint4 yyxy 667 { 668 [MethodImpl(MethodImplOptions.AggressiveInlining)] 669 get { return new uint4(y, y, x, y); } 670 } 671 672 673 /// <summary>Swizzles the vector.</summary> 674 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 675 public uint4 yyyx 676 { 677 [MethodImpl(MethodImplOptions.AggressiveInlining)] 678 get { return new uint4(y, y, y, x); } 679 } 680 681 682 /// <summary>Swizzles the vector.</summary> 683 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 684 public uint4 yyyy 685 { 686 [MethodImpl(MethodImplOptions.AggressiveInlining)] 687 get { return new uint4(y, y, y, y); } 688 } 689 690 691 /// <summary>Swizzles the vector.</summary> 692 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 693 public uint3 xxx 694 { 695 [MethodImpl(MethodImplOptions.AggressiveInlining)] 696 get { return new uint3(x, x, x); } 697 } 698 699 700 /// <summary>Swizzles the vector.</summary> 701 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 702 public uint3 xxy 703 { 704 [MethodImpl(MethodImplOptions.AggressiveInlining)] 705 get { return new uint3(x, x, y); } 706 } 707 708 709 /// <summary>Swizzles the vector.</summary> 710 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 711 public uint3 xyx 712 { 713 [MethodImpl(MethodImplOptions.AggressiveInlining)] 714 get { return new uint3(x, y, x); } 715 } 716 717 718 /// <summary>Swizzles the vector.</summary> 719 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 720 public uint3 xyy 721 { 722 [MethodImpl(MethodImplOptions.AggressiveInlining)] 723 get { return new uint3(x, y, y); } 724 } 725 726 727 /// <summary>Swizzles the vector.</summary> 728 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 729 public uint3 yxx 730 { 731 [MethodImpl(MethodImplOptions.AggressiveInlining)] 732 get { return new uint3(y, x, x); } 733 } 734 735 736 /// <summary>Swizzles the vector.</summary> 737 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 738 public uint3 yxy 739 { 740 [MethodImpl(MethodImplOptions.AggressiveInlining)] 741 get { return new uint3(y, x, y); } 742 } 743 744 745 /// <summary>Swizzles the vector.</summary> 746 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 747 public uint3 yyx 748 { 749 [MethodImpl(MethodImplOptions.AggressiveInlining)] 750 get { return new uint3(y, y, x); } 751 } 752 753 754 /// <summary>Swizzles the vector.</summary> 755 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 756 public uint3 yyy 757 { 758 [MethodImpl(MethodImplOptions.AggressiveInlining)] 759 get { return new uint3(y, y, y); } 760 } 761 762 763 /// <summary>Swizzles the vector.</summary> 764 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 765 public uint2 xx 766 { 767 [MethodImpl(MethodImplOptions.AggressiveInlining)] 768 get { return new uint2(x, x); } 769 } 770 771 772 /// <summary>Swizzles the vector.</summary> 773 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 774 public uint2 xy 775 { 776 [MethodImpl(MethodImplOptions.AggressiveInlining)] 777 get { return new uint2(x, y); } 778 [MethodImpl(MethodImplOptions.AggressiveInlining)] 779 set { x = value.x; y = value.y; } 780 } 781 782 783 /// <summary>Swizzles the vector.</summary> 784 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 785 public uint2 yx 786 { 787 [MethodImpl(MethodImplOptions.AggressiveInlining)] 788 get { return new uint2(y, x); } 789 [MethodImpl(MethodImplOptions.AggressiveInlining)] 790 set { y = value.x; x = value.y; } 791 } 792 793 794 /// <summary>Swizzles the vector.</summary> 795 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 796 public uint2 yy 797 { 798 [MethodImpl(MethodImplOptions.AggressiveInlining)] 799 get { return new uint2(y, y); } 800 } 801 802 803 804 /// <summary>Returns the uint element at a specified index.</summary> 805 unsafe public uint this[int index] 806 { 807 get 808 { 809#if ENABLE_UNITY_COLLECTIONS_CHECKS 810 if ((uint)index >= 2) 811 throw new System.ArgumentException("index must be between[0...1]"); 812#endif 813 fixed (uint2* array = &this) { return ((uint*)array)[index]; } 814 } 815 set 816 { 817#if ENABLE_UNITY_COLLECTIONS_CHECKS 818 if ((uint)index >= 2) 819 throw new System.ArgumentException("index must be between[0...1]"); 820#endif 821 fixed (uint* array = &x) { array[index] = value; } 822 } 823 } 824 825 /// <summary>Returns true if the uint2 is equal to a given uint2, false otherwise.</summary> 826 /// <param name="rhs">Right hand side argument to compare equality with.</param> 827 /// <returns>The result of the equality comparison.</returns> 828 [MethodImpl(MethodImplOptions.AggressiveInlining)] 829 public bool Equals(uint2 rhs) { return x == rhs.x && y == rhs.y; } 830 831 /// <summary>Returns true if the uint2 is equal to a given uint2, false otherwise.</summary> 832 /// <param name="o">Right hand side argument to compare equality with.</param> 833 /// <returns>The result of the equality comparison.</returns> 834 public override bool Equals(object o) { return o is uint2 converted && Equals(converted); } 835 836 837 /// <summary>Returns a hash code for the uint2.</summary> 838 /// <returns>The computed hash code.</returns> 839 [MethodImpl(MethodImplOptions.AggressiveInlining)] 840 public override int GetHashCode() { return (int)math.hash(this); } 841 842 843 /// <summary>Returns a string representation of the uint2.</summary> 844 /// <returns>String representation of the value.</returns> 845 [MethodImpl(MethodImplOptions.AggressiveInlining)] 846 public override string ToString() 847 { 848 return string.Format("uint2({0}, {1})", x, y); 849 } 850 851 /// <summary>Returns a string representation of the uint2 using a specified format and culture-specific format information.</summary> 852 /// <param name="format">Format string to use during string formatting.</param> 853 /// <param name="formatProvider">Format provider to use during string formatting.</param> 854 /// <returns>String representation of the value.</returns> 855 [MethodImpl(MethodImplOptions.AggressiveInlining)] 856 public string ToString(string format, IFormatProvider formatProvider) 857 { 858 return string.Format("uint2({0}, {1})", x.ToString(format, formatProvider), y.ToString(format, formatProvider)); 859 } 860 861 internal sealed class DebuggerProxy 862 { 863 public uint x; 864 public uint y; 865 public DebuggerProxy(uint2 v) 866 { 867 x = v.x; 868 y = v.y; 869 } 870 } 871 872 } 873 874 public static partial class math 875 { 876 /// <summary>Returns a uint2 vector constructed from two uint values.</summary> 877 /// <param name="x">The constructed vector's x component will be set to this value.</param> 878 /// <param name="y">The constructed vector's y component will be set to this value.</param> 879 /// <returns>uint2 constructed from arguments.</returns> 880 [MethodImpl(MethodImplOptions.AggressiveInlining)] 881 public static uint2 uint2(uint x, uint y) { return new uint2(x, y); } 882 883 /// <summary>Returns a uint2 vector constructed from a uint2 vector.</summary> 884 /// <param name="xy">The constructed vector's xy components will be set to this value.</param> 885 /// <returns>uint2 constructed from arguments.</returns> 886 [MethodImpl(MethodImplOptions.AggressiveInlining)] 887 public static uint2 uint2(uint2 xy) { return new uint2(xy); } 888 889 /// <summary>Returns a uint2 vector constructed from a single uint value by assigning it to every component.</summary> 890 /// <param name="v">uint to convert to uint2</param> 891 /// <returns>Converted value.</returns> 892 [MethodImpl(MethodImplOptions.AggressiveInlining)] 893 public static uint2 uint2(uint v) { return new uint2(v); } 894 895 /// <summary>Returns a uint2 vector constructed from a single bool value by converting it to uint and assigning it to every component.</summary> 896 /// <param name="v">bool to convert to uint2</param> 897 /// <returns>Converted value.</returns> 898 [MethodImpl(MethodImplOptions.AggressiveInlining)] 899 public static uint2 uint2(bool v) { return new uint2(v); } 900 901 /// <summary>Return a uint2 vector constructed from a bool2 vector by componentwise conversion.</summary> 902 /// <param name="v">bool2 to convert to uint2</param> 903 /// <returns>Converted value.</returns> 904 [MethodImpl(MethodImplOptions.AggressiveInlining)] 905 public static uint2 uint2(bool2 v) { return new uint2(v); } 906 907 /// <summary>Returns a uint2 vector constructed from a single int value by converting it to uint and assigning it to every component.</summary> 908 /// <param name="v">int to convert to uint2</param> 909 /// <returns>Converted value.</returns> 910 [MethodImpl(MethodImplOptions.AggressiveInlining)] 911 public static uint2 uint2(int v) { return new uint2(v); } 912 913 /// <summary>Return a uint2 vector constructed from a int2 vector by componentwise conversion.</summary> 914 /// <param name="v">int2 to convert to uint2</param> 915 /// <returns>Converted value.</returns> 916 [MethodImpl(MethodImplOptions.AggressiveInlining)] 917 public static uint2 uint2(int2 v) { return new uint2(v); } 918 919 /// <summary>Returns a uint2 vector constructed from a single float value by converting it to uint and assigning it to every component.</summary> 920 /// <param name="v">float to convert to uint2</param> 921 /// <returns>Converted value.</returns> 922 [MethodImpl(MethodImplOptions.AggressiveInlining)] 923 public static uint2 uint2(float v) { return new uint2(v); } 924 925 /// <summary>Return a uint2 vector constructed from a float2 vector by componentwise conversion.</summary> 926 /// <param name="v">float2 to convert to uint2</param> 927 /// <returns>Converted value.</returns> 928 [MethodImpl(MethodImplOptions.AggressiveInlining)] 929 public static uint2 uint2(float2 v) { return new uint2(v); } 930 931 /// <summary>Returns a uint2 vector constructed from a single double value by converting it to uint and assigning it to every component.</summary> 932 /// <param name="v">double to convert to uint2</param> 933 /// <returns>Converted value.</returns> 934 [MethodImpl(MethodImplOptions.AggressiveInlining)] 935 public static uint2 uint2(double v) { return new uint2(v); } 936 937 /// <summary>Return a uint2 vector constructed from a double2 vector by componentwise conversion.</summary> 938 /// <param name="v">double2 to convert to uint2</param> 939 /// <returns>Converted value.</returns> 940 [MethodImpl(MethodImplOptions.AggressiveInlining)] 941 public static uint2 uint2(double2 v) { return new uint2(v); } 942 943 /// <summary>Returns a uint hash code of a uint2 vector.</summary> 944 /// <param name="v">Vector value to hash.</param> 945 /// <returns>uint hash of the argument.</returns> 946 [MethodImpl(MethodImplOptions.AggressiveInlining)] 947 public static uint hash(uint2 v) 948 { 949 return csum(v * uint2(0x4473BBB1u, 0xCBA11D5Fu)) + 0x685835CFu; 950 } 951 952 /// <summary> 953 /// Returns a uint2 vector hash code of a uint2 vector. 954 /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash 955 /// that are only reduced to a narrow uint hash at the very end instead of at every step. 956 /// </summary> 957 /// <param name="v">Vector value to hash.</param> 958 /// <returns>uint2 hash of the argument.</returns> 959 [MethodImpl(MethodImplOptions.AggressiveInlining)] 960 public static uint2 hashwide(uint2 v) 961 { 962 return (v * uint2(0xC3D32AE1u, 0xB966942Fu)) + 0xFE9856B3u; 963 } 964 965 /// <summary>Returns the result of specified shuffling of the components from two uint2 vectors into a uint value.</summary> 966 /// <param name="left">uint2 to use as the left argument of the shuffle operation.</param> 967 /// <param name="right">uint2 to use as the right argument of the shuffle operation.</param> 968 /// <param name="x">The ShuffleComponent to use when setting the resulting uint.</param> 969 /// <returns>uint result of the shuffle operation.</returns> 970 [MethodImpl(MethodImplOptions.AggressiveInlining)] 971 public static uint shuffle(uint2 left, uint2 right, ShuffleComponent x) 972 { 973 return select_shuffle_component(left, right, x); 974 } 975 976 /// <summary>Returns the result of specified shuffling of the components from two uint2 vectors into a uint2 vector.</summary> 977 /// <param name="left">uint2 to use as the left argument of the shuffle operation.</param> 978 /// <param name="right">uint2 to use as the right argument of the shuffle operation.</param> 979 /// <param name="x">The ShuffleComponent to use when setting the resulting uint2 x component.</param> 980 /// <param name="y">The ShuffleComponent to use when setting the resulting uint2 y component.</param> 981 /// <returns>uint2 result of the shuffle operation.</returns> 982 [MethodImpl(MethodImplOptions.AggressiveInlining)] 983 public static uint2 shuffle(uint2 left, uint2 right, ShuffleComponent x, ShuffleComponent y) 984 { 985 return uint2( 986 select_shuffle_component(left, right, x), 987 select_shuffle_component(left, right, y)); 988 } 989 990 /// <summary>Returns the result of specified shuffling of the components from two uint2 vectors into a uint3 vector.</summary> 991 /// <param name="left">uint2 to use as the left argument of the shuffle operation.</param> 992 /// <param name="right">uint2 to use as the right argument of the shuffle operation.</param> 993 /// <param name="x">The ShuffleComponent to use when setting the resulting uint3 x component.</param> 994 /// <param name="y">The ShuffleComponent to use when setting the resulting uint3 y component.</param> 995 /// <param name="z">The ShuffleComponent to use when setting the resulting uint3 z component.</param> 996 /// <returns>uint3 result of the shuffle operation.</returns> 997 [MethodImpl(MethodImplOptions.AggressiveInlining)] 998 public static uint3 shuffle(uint2 left, uint2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z) 999 { 1000 return uint3( 1001 select_shuffle_component(left, right, x), 1002 select_shuffle_component(left, right, y), 1003 select_shuffle_component(left, right, z)); 1004 } 1005 1006 /// <summary>Returns the result of specified shuffling of the components from two uint2 vectors into a uint4 vector.</summary> 1007 /// <param name="left">uint2 to use as the left argument of the shuffle operation.</param> 1008 /// <param name="right">uint2 to use as the right argument of the shuffle operation.</param> 1009 /// <param name="x">The ShuffleComponent to use when setting the resulting uint4 x component.</param> 1010 /// <param name="y">The ShuffleComponent to use when setting the resulting uint4 y component.</param> 1011 /// <param name="z">The ShuffleComponent to use when setting the resulting uint4 z component.</param> 1012 /// <param name="w">The ShuffleComponent to use when setting the resulting uint4 w component.</param> 1013 /// <returns>uint4 result of the shuffle operation.</returns> 1014 [MethodImpl(MethodImplOptions.AggressiveInlining)] 1015 public static uint4 shuffle(uint2 left, uint2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w) 1016 { 1017 return uint4( 1018 select_shuffle_component(left, right, x), 1019 select_shuffle_component(left, right, y), 1020 select_shuffle_component(left, right, z), 1021 select_shuffle_component(left, right, w)); 1022 } 1023 1024 [MethodImpl(MethodImplOptions.AggressiveInlining)] 1025 internal static uint select_shuffle_component(uint2 a, uint2 b, ShuffleComponent component) 1026 { 1027 switch(component) 1028 { 1029 case ShuffleComponent.LeftX: 1030 return a.x; 1031 case ShuffleComponent.LeftY: 1032 return a.y; 1033 case ShuffleComponent.RightX: 1034 return b.x; 1035 case ShuffleComponent.RightY: 1036 return b.y; 1037 default: 1038 throw new System.ArgumentException("Invalid shuffle component: " + component); 1039 } 1040 } 1041 1042 } 1043}