uint2.gen.cs 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  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.
  7. // </auto-generated>
  8. //------------------------------------------------------------------------------
  9. using System;
  10. using System.Runtime.CompilerServices;
  11. using System.Diagnostics;
  12. #pragma warning disable 0660, 0661
  13. namespace Unity.Mathematics
  14. {
  15. [DebuggerTypeProxy(typeof(uint2.DebuggerProxy))]
  16. [System.Serializable]
  17. public partial struct uint2 : System.IEquatable<uint2>, IFormattable
  18. {
  19. public uint x;
  20. public uint y;
  21. /// <summary>uint2 zero value.</summary>
  22. public static readonly uint2 zero;
  23. /// <summary>Constructs a uint2 vector from two uint values.</summary>
  24. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  25. public uint2(uint x, uint y)
  26. {
  27. this.x = x;
  28. this.y = y;
  29. }
  30. /// <summary>Constructs a uint2 vector from a uint2 vector.</summary>
  31. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  32. public uint2(uint2 xy)
  33. {
  34. this.x = xy.x;
  35. this.y = xy.y;
  36. }
  37. /// <summary>Constructs a uint2 vector from a single uint value by assigning it to every component.</summary>
  38. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  39. public uint2(uint v)
  40. {
  41. this.x = v;
  42. this.y = v;
  43. }
  44. /// <summary>Constructs a uint2 vector from a single bool value by converting it to uint and assigning it to every component.</summary>
  45. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  46. public uint2(bool v)
  47. {
  48. this.x = v ? 1u : 0u;
  49. this.y = v ? 1u : 0u;
  50. }
  51. /// <summary>Constructs a uint2 vector from a bool2 vector by componentwise conversion.</summary>
  52. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  53. public uint2(bool2 v)
  54. {
  55. this.x = v.x ? 1u : 0u;
  56. this.y = v.y ? 1u : 0u;
  57. }
  58. /// <summary>Constructs a uint2 vector from a single int value by converting it to uint and assigning it to every component.</summary>
  59. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  60. public uint2(int v)
  61. {
  62. this.x = (uint)v;
  63. this.y = (uint)v;
  64. }
  65. /// <summary>Constructs a uint2 vector from a int2 vector by componentwise conversion.</summary>
  66. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  67. public uint2(int2 v)
  68. {
  69. this.x = (uint)v.x;
  70. this.y = (uint)v.y;
  71. }
  72. /// <summary>Constructs a uint2 vector from a single float value by converting it to uint and assigning it to every component.</summary>
  73. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  74. public uint2(float v)
  75. {
  76. this.x = (uint)v;
  77. this.y = (uint)v;
  78. }
  79. /// <summary>Constructs a uint2 vector from a float2 vector by componentwise conversion.</summary>
  80. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  81. public uint2(float2 v)
  82. {
  83. this.x = (uint)v.x;
  84. this.y = (uint)v.y;
  85. }
  86. /// <summary>Constructs a uint2 vector from a single double value by converting it to uint and assigning it to every component.</summary>
  87. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  88. public uint2(double v)
  89. {
  90. this.x = (uint)v;
  91. this.y = (uint)v;
  92. }
  93. /// <summary>Constructs a uint2 vector from a double2 vector by componentwise conversion.</summary>
  94. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  95. public uint2(double2 v)
  96. {
  97. this.x = (uint)v.x;
  98. this.y = (uint)v.y;
  99. }
  100. /// <summary>Implicitly converts a single uint value to a uint2 vector by assigning it to every component.</summary>
  101. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  102. public static implicit operator uint2(uint v) { return new uint2(v); }
  103. /// <summary>Explicitly converts a single bool value to a uint2 vector by converting it to uint and assigning it to every component.</summary>
  104. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  105. public static explicit operator uint2(bool v) { return new uint2(v); }
  106. /// <summary>Explicitly converts a bool2 vector to a uint2 vector by componentwise conversion.</summary>
  107. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  108. public static explicit operator uint2(bool2 v) { return new uint2(v); }
  109. /// <summary>Explicitly converts a single int value to a uint2 vector by converting it to uint and assigning it to every component.</summary>
  110. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  111. public static explicit operator uint2(int v) { return new uint2(v); }
  112. /// <summary>Explicitly converts a int2 vector to a uint2 vector by componentwise conversion.</summary>
  113. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  114. public static explicit operator uint2(int2 v) { return new uint2(v); }
  115. /// <summary>Explicitly converts a single float value to a uint2 vector by converting it to uint and assigning it to every component.</summary>
  116. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  117. public static explicit operator uint2(float v) { return new uint2(v); }
  118. /// <summary>Explicitly converts a float2 vector to a uint2 vector by componentwise conversion.</summary>
  119. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  120. public static explicit operator uint2(float2 v) { return new uint2(v); }
  121. /// <summary>Explicitly converts a single double value to a uint2 vector by converting it to uint and assigning it to every component.</summary>
  122. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  123. public static explicit operator uint2(double v) { return new uint2(v); }
  124. /// <summary>Explicitly converts a double2 vector to a uint2 vector by componentwise conversion.</summary>
  125. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  126. public static explicit operator uint2(double2 v) { return new uint2(v); }
  127. /// <summary>Returns the result of a componentwise multiplication operation on two uint2 vectors.</summary>
  128. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  129. public static uint2 operator * (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x * rhs.x, lhs.y * rhs.y); }
  130. /// <summary>Returns the result of a componentwise multiplication operation on a uint2 vector and a uint value.</summary>
  131. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  132. public static uint2 operator * (uint2 lhs, uint rhs) { return new uint2 (lhs.x * rhs, lhs.y * rhs); }
  133. /// <summary>Returns the result of a componentwise multiplication operation on a uint value and a uint2 vector.</summary>
  134. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  135. public static uint2 operator * (uint lhs, uint2 rhs) { return new uint2 (lhs * rhs.x, lhs * rhs.y); }
  136. /// <summary>Returns the result of a componentwise addition operation on two uint2 vectors.</summary>
  137. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  138. public static uint2 operator + (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x + rhs.x, lhs.y + rhs.y); }
  139. /// <summary>Returns the result of a componentwise addition operation on a uint2 vector and a uint value.</summary>
  140. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  141. public static uint2 operator + (uint2 lhs, uint rhs) { return new uint2 (lhs.x + rhs, lhs.y + rhs); }
  142. /// <summary>Returns the result of a componentwise addition operation on a uint value and a uint2 vector.</summary>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public static uint2 operator + (uint lhs, uint2 rhs) { return new uint2 (lhs + rhs.x, lhs + rhs.y); }
  145. /// <summary>Returns the result of a componentwise subtraction operation on two uint2 vectors.</summary>
  146. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  147. public static uint2 operator - (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x - rhs.x, lhs.y - rhs.y); }
  148. /// <summary>Returns the result of a componentwise subtraction operation on a uint2 vector and a uint value.</summary>
  149. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  150. public static uint2 operator - (uint2 lhs, uint rhs) { return new uint2 (lhs.x - rhs, lhs.y - rhs); }
  151. /// <summary>Returns the result of a componentwise subtraction operation on a uint value and a uint2 vector.</summary>
  152. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  153. public static uint2 operator - (uint lhs, uint2 rhs) { return new uint2 (lhs - rhs.x, lhs - rhs.y); }
  154. /// <summary>Returns the result of a componentwise division operation on two uint2 vectors.</summary>
  155. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  156. public static uint2 operator / (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x / rhs.x, lhs.y / rhs.y); }
  157. /// <summary>Returns the result of a componentwise division operation on a uint2 vector and a uint value.</summary>
  158. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  159. public static uint2 operator / (uint2 lhs, uint rhs) { return new uint2 (lhs.x / rhs, lhs.y / rhs); }
  160. /// <summary>Returns the result of a componentwise division operation on a uint value and a uint2 vector.</summary>
  161. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  162. public static uint2 operator / (uint lhs, uint2 rhs) { return new uint2 (lhs / rhs.x, lhs / rhs.y); }
  163. /// <summary>Returns the result of a componentwise modulus operation on two uint2 vectors.</summary>
  164. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  165. public static uint2 operator % (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x % rhs.x, lhs.y % rhs.y); }
  166. /// <summary>Returns the result of a componentwise modulus operation on a uint2 vector and a uint value.</summary>
  167. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  168. public static uint2 operator % (uint2 lhs, uint rhs) { return new uint2 (lhs.x % rhs, lhs.y % rhs); }
  169. /// <summary>Returns the result of a componentwise modulus operation on a uint value and a uint2 vector.</summary>
  170. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  171. public static uint2 operator % (uint lhs, uint2 rhs) { return new uint2 (lhs % rhs.x, lhs % rhs.y); }
  172. /// <summary>Returns the result of a componentwise increment operation on a uint2 vector.</summary>
  173. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  174. public static uint2 operator ++ (uint2 val) { return new uint2 (++val.x, ++val.y); }
  175. /// <summary>Returns the result of a componentwise decrement operation on a uint2 vector.</summary>
  176. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  177. public static uint2 operator -- (uint2 val) { return new uint2 (--val.x, --val.y); }
  178. /// <summary>Returns the result of a componentwise less than operation on two uint2 vectors.</summary>
  179. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  180. public static bool2 operator < (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x < rhs.x, lhs.y < rhs.y); }
  181. /// <summary>Returns the result of a componentwise less than operation on a uint2 vector and a uint value.</summary>
  182. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  183. public static bool2 operator < (uint2 lhs, uint rhs) { return new bool2 (lhs.x < rhs, lhs.y < rhs); }
  184. /// <summary>Returns the result of a componentwise less than operation on a uint value and a uint2 vector.</summary>
  185. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  186. public static bool2 operator < (uint lhs, uint2 rhs) { return new bool2 (lhs < rhs.x, lhs < rhs.y); }
  187. /// <summary>Returns the result of a componentwise less or equal operation on two uint2 vectors.</summary>
  188. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  189. public static bool2 operator <= (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x <= rhs.x, lhs.y <= rhs.y); }
  190. /// <summary>Returns the result of a componentwise less or equal operation on a uint2 vector and a uint value.</summary>
  191. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  192. public static bool2 operator <= (uint2 lhs, uint rhs) { return new bool2 (lhs.x <= rhs, lhs.y <= rhs); }
  193. /// <summary>Returns the result of a componentwise less or equal operation on a uint value and a uint2 vector.</summary>
  194. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  195. public static bool2 operator <= (uint lhs, uint2 rhs) { return new bool2 (lhs <= rhs.x, lhs <= rhs.y); }
  196. /// <summary>Returns the result of a componentwise greater than operation on two uint2 vectors.</summary>
  197. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  198. public static bool2 operator > (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x > rhs.x, lhs.y > rhs.y); }
  199. /// <summary>Returns the result of a componentwise greater than operation on a uint2 vector and a uint value.</summary>
  200. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  201. public static bool2 operator > (uint2 lhs, uint rhs) { return new bool2 (lhs.x > rhs, lhs.y > rhs); }
  202. /// <summary>Returns the result of a componentwise greater than operation on a uint value and a uint2 vector.</summary>
  203. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  204. public static bool2 operator > (uint lhs, uint2 rhs) { return new bool2 (lhs > rhs.x, lhs > rhs.y); }
  205. /// <summary>Returns the result of a componentwise greater or equal operation on two uint2 vectors.</summary>
  206. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  207. public static bool2 operator >= (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x >= rhs.x, lhs.y >= rhs.y); }
  208. /// <summary>Returns the result of a componentwise greater or equal operation on a uint2 vector and a uint value.</summary>
  209. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  210. public static bool2 operator >= (uint2 lhs, uint rhs) { return new bool2 (lhs.x >= rhs, lhs.y >= rhs); }
  211. /// <summary>Returns the result of a componentwise greater or equal operation on a uint value and a uint2 vector.</summary>
  212. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  213. public static bool2 operator >= (uint lhs, uint2 rhs) { return new bool2 (lhs >= rhs.x, lhs >= rhs.y); }
  214. /// <summary>Returns the result of a componentwise unary minus operation on a uint2 vector.</summary>
  215. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  216. public static uint2 operator - (uint2 val) { return new uint2 ((uint)-val.x, (uint)-val.y); }
  217. /// <summary>Returns the result of a componentwise unary plus operation on a uint2 vector.</summary>
  218. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  219. public static uint2 operator + (uint2 val) { return new uint2 (+val.x, +val.y); }
  220. /// <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>
  221. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  222. public static uint2 operator << (uint2 x, int n) { return new uint2 (x.x << n, x.y << n); }
  223. /// <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>
  224. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  225. public static uint2 operator >> (uint2 x, int n) { return new uint2 (x.x >> n, x.y >> n); }
  226. /// <summary>Returns the result of a componentwise equality operation on two uint2 vectors.</summary>
  227. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  228. public static bool2 operator == (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x == rhs.x, lhs.y == rhs.y); }
  229. /// <summary>Returns the result of a componentwise equality operation on a uint2 vector and a uint value.</summary>
  230. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  231. public static bool2 operator == (uint2 lhs, uint rhs) { return new bool2 (lhs.x == rhs, lhs.y == rhs); }
  232. /// <summary>Returns the result of a componentwise equality operation on a uint value and a uint2 vector.</summary>
  233. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  234. public static bool2 operator == (uint lhs, uint2 rhs) { return new bool2 (lhs == rhs.x, lhs == rhs.y); }
  235. /// <summary>Returns the result of a componentwise not equal operation on two uint2 vectors.</summary>
  236. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  237. public static bool2 operator != (uint2 lhs, uint2 rhs) { return new bool2 (lhs.x != rhs.x, lhs.y != rhs.y); }
  238. /// <summary>Returns the result of a componentwise not equal operation on a uint2 vector and a uint value.</summary>
  239. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  240. public static bool2 operator != (uint2 lhs, uint rhs) { return new bool2 (lhs.x != rhs, lhs.y != rhs); }
  241. /// <summary>Returns the result of a componentwise not equal operation on a uint value and a uint2 vector.</summary>
  242. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  243. public static bool2 operator != (uint lhs, uint2 rhs) { return new bool2 (lhs != rhs.x, lhs != rhs.y); }
  244. /// <summary>Returns the result of a componentwise bitwise not operation on a uint2 vector.</summary>
  245. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  246. public static uint2 operator ~ (uint2 val) { return new uint2 (~val.x, ~val.y); }
  247. /// <summary>Returns the result of a componentwise bitwise and operation on two uint2 vectors.</summary>
  248. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  249. public static uint2 operator & (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x & rhs.x, lhs.y & rhs.y); }
  250. /// <summary>Returns the result of a componentwise bitwise and operation on a uint2 vector and a uint value.</summary>
  251. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  252. public static uint2 operator & (uint2 lhs, uint rhs) { return new uint2 (lhs.x & rhs, lhs.y & rhs); }
  253. /// <summary>Returns the result of a componentwise bitwise and operation on a uint value and a uint2 vector.</summary>
  254. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  255. public static uint2 operator & (uint lhs, uint2 rhs) { return new uint2 (lhs & rhs.x, lhs & rhs.y); }
  256. /// <summary>Returns the result of a componentwise bitwise or operation on two uint2 vectors.</summary>
  257. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  258. public static uint2 operator | (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x | rhs.x, lhs.y | rhs.y); }
  259. /// <summary>Returns the result of a componentwise bitwise or operation on a uint2 vector and a uint value.</summary>
  260. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  261. public static uint2 operator | (uint2 lhs, uint rhs) { return new uint2 (lhs.x | rhs, lhs.y | rhs); }
  262. /// <summary>Returns the result of a componentwise bitwise or operation on a uint value and a uint2 vector.</summary>
  263. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  264. public static uint2 operator | (uint lhs, uint2 rhs) { return new uint2 (lhs | rhs.x, lhs | rhs.y); }
  265. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two uint2 vectors.</summary>
  266. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  267. public static uint2 operator ^ (uint2 lhs, uint2 rhs) { return new uint2 (lhs.x ^ rhs.x, lhs.y ^ rhs.y); }
  268. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a uint2 vector and a uint value.</summary>
  269. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  270. public static uint2 operator ^ (uint2 lhs, uint rhs) { return new uint2 (lhs.x ^ rhs, lhs.y ^ rhs); }
  271. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint2 vector.</summary>
  272. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  273. public static uint2 operator ^ (uint lhs, uint2 rhs) { return new uint2 (lhs ^ rhs.x, lhs ^ rhs.y); }
  274. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  275. public uint4 xxxx
  276. {
  277. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  278. get { return new uint4(x, x, x, x); }
  279. }
  280. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  281. public uint4 xxxy
  282. {
  283. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  284. get { return new uint4(x, x, x, y); }
  285. }
  286. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  287. public uint4 xxyx
  288. {
  289. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  290. get { return new uint4(x, x, y, x); }
  291. }
  292. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  293. public uint4 xxyy
  294. {
  295. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  296. get { return new uint4(x, x, y, y); }
  297. }
  298. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  299. public uint4 xyxx
  300. {
  301. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  302. get { return new uint4(x, y, x, x); }
  303. }
  304. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  305. public uint4 xyxy
  306. {
  307. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  308. get { return new uint4(x, y, x, y); }
  309. }
  310. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  311. public uint4 xyyx
  312. {
  313. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  314. get { return new uint4(x, y, y, x); }
  315. }
  316. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  317. public uint4 xyyy
  318. {
  319. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  320. get { return new uint4(x, y, y, y); }
  321. }
  322. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  323. public uint4 yxxx
  324. {
  325. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  326. get { return new uint4(y, x, x, x); }
  327. }
  328. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  329. public uint4 yxxy
  330. {
  331. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  332. get { return new uint4(y, x, x, y); }
  333. }
  334. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  335. public uint4 yxyx
  336. {
  337. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  338. get { return new uint4(y, x, y, x); }
  339. }
  340. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  341. public uint4 yxyy
  342. {
  343. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  344. get { return new uint4(y, x, y, y); }
  345. }
  346. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  347. public uint4 yyxx
  348. {
  349. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  350. get { return new uint4(y, y, x, x); }
  351. }
  352. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  353. public uint4 yyxy
  354. {
  355. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  356. get { return new uint4(y, y, x, y); }
  357. }
  358. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  359. public uint4 yyyx
  360. {
  361. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  362. get { return new uint4(y, y, y, x); }
  363. }
  364. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  365. public uint4 yyyy
  366. {
  367. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  368. get { return new uint4(y, y, y, y); }
  369. }
  370. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  371. public uint3 xxx
  372. {
  373. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  374. get { return new uint3(x, x, x); }
  375. }
  376. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  377. public uint3 xxy
  378. {
  379. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  380. get { return new uint3(x, x, y); }
  381. }
  382. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  383. public uint3 xyx
  384. {
  385. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  386. get { return new uint3(x, y, x); }
  387. }
  388. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  389. public uint3 xyy
  390. {
  391. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  392. get { return new uint3(x, y, y); }
  393. }
  394. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  395. public uint3 yxx
  396. {
  397. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  398. get { return new uint3(y, x, x); }
  399. }
  400. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  401. public uint3 yxy
  402. {
  403. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  404. get { return new uint3(y, x, y); }
  405. }
  406. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  407. public uint3 yyx
  408. {
  409. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  410. get { return new uint3(y, y, x); }
  411. }
  412. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  413. public uint3 yyy
  414. {
  415. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  416. get { return new uint3(y, y, y); }
  417. }
  418. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  419. public uint2 xx
  420. {
  421. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  422. get { return new uint2(x, x); }
  423. }
  424. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  425. public uint2 xy
  426. {
  427. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  428. get { return new uint2(x, y); }
  429. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  430. set { x = value.x; y = value.y; }
  431. }
  432. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  433. public uint2 yx
  434. {
  435. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  436. get { return new uint2(y, x); }
  437. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  438. set { y = value.x; x = value.y; }
  439. }
  440. [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
  441. public uint2 yy
  442. {
  443. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  444. get { return new uint2(y, y); }
  445. }
  446. /// <summary>Returns the uint element at a specified index.</summary>
  447. unsafe public uint this[int index]
  448. {
  449. get
  450. {
  451. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  452. if ((uint)index >= 2)
  453. throw new System.ArgumentException("index must be between[0...1]");
  454. #endif
  455. fixed (uint2* array = &this) { return ((uint*)array)[index]; }
  456. }
  457. set
  458. {
  459. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  460. if ((uint)index >= 2)
  461. throw new System.ArgumentException("index must be between[0...1]");
  462. #endif
  463. fixed (uint* array = &x) { array[index] = value; }
  464. }
  465. }
  466. /// <summary>Returns true if the uint2 is equal to a given uint2, false otherwise.</summary>
  467. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  468. public bool Equals(uint2 rhs) { return x == rhs.x && y == rhs.y; }
  469. /// <summary>Returns true if the uint2 is equal to a given uint2, false otherwise.</summary>
  470. public override bool Equals(object o) { return Equals((uint2)o); }
  471. /// <summary>Returns a hash code for the uint2.</summary>
  472. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  473. public override int GetHashCode() { return (int)math.hash(this); }
  474. /// <summary>Returns a string representation of the uint2.</summary>
  475. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  476. public override string ToString()
  477. {
  478. return string.Format("uint2({0}, {1})", x, y);
  479. }
  480. /// <summary>Returns a string representation of the uint2 using a specified format and culture-specific format information.</summary>
  481. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  482. public string ToString(string format, IFormatProvider formatProvider)
  483. {
  484. return string.Format("uint2({0}, {1})", x.ToString(format, formatProvider), y.ToString(format, formatProvider));
  485. }
  486. internal sealed class DebuggerProxy
  487. {
  488. public uint x;
  489. public uint y;
  490. public DebuggerProxy(uint2 v)
  491. {
  492. x = v.x;
  493. y = v.y;
  494. }
  495. }
  496. }
  497. public static partial class math
  498. {
  499. /// <summary>Returns a uint2 vector constructed from two uint values.</summary>
  500. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  501. public static uint2 uint2(uint x, uint y) { return new uint2(x, y); }
  502. /// <summary>Returns a uint2 vector constructed from a uint2 vector.</summary>
  503. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  504. public static uint2 uint2(uint2 xy) { return new uint2(xy); }
  505. /// <summary>Returns a uint2 vector constructed from a single uint value by assigning it to every component.</summary>
  506. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  507. public static uint2 uint2(uint v) { return new uint2(v); }
  508. /// <summary>Returns a uint2 vector constructed from a single bool value by converting it to uint and assigning it to every component.</summary>
  509. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  510. public static uint2 uint2(bool v) { return new uint2(v); }
  511. /// <summary>Return a uint2 vector constructed from a bool2 vector by componentwise conversion.</summary>
  512. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  513. public static uint2 uint2(bool2 v) { return new uint2(v); }
  514. /// <summary>Returns a uint2 vector constructed from a single int value by converting it to uint and assigning it to every component.</summary>
  515. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  516. public static uint2 uint2(int v) { return new uint2(v); }
  517. /// <summary>Return a uint2 vector constructed from a int2 vector by componentwise conversion.</summary>
  518. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  519. public static uint2 uint2(int2 v) { return new uint2(v); }
  520. /// <summary>Returns a uint2 vector constructed from a single float value by converting it to uint and assigning it to every component.</summary>
  521. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  522. public static uint2 uint2(float v) { return new uint2(v); }
  523. /// <summary>Return a uint2 vector constructed from a float2 vector by componentwise conversion.</summary>
  524. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  525. public static uint2 uint2(float2 v) { return new uint2(v); }
  526. /// <summary>Returns a uint2 vector constructed from a single double value by converting it to uint and assigning it to every component.</summary>
  527. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  528. public static uint2 uint2(double v) { return new uint2(v); }
  529. /// <summary>Return a uint2 vector constructed from a double2 vector by componentwise conversion.</summary>
  530. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  531. public static uint2 uint2(double2 v) { return new uint2(v); }
  532. /// <summary>Returns a uint hash code of a uint2 vector.</summary>
  533. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  534. public static uint hash(uint2 v)
  535. {
  536. return csum(v * uint2(0x4473BBB1u, 0xCBA11D5Fu)) + 0x685835CFu;
  537. }
  538. /// <summary>
  539. /// Returns a uint2 vector hash code of a uint2 vector.
  540. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  541. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  542. /// </summary>
  543. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  544. public static uint2 hashwide(uint2 v)
  545. {
  546. return (v * uint2(0xC3D32AE1u, 0xB966942Fu)) + 0xFE9856B3u;
  547. }
  548. /// <summary>Returns the result of specified shuffling of the components from two uint2 vectors into a uint value.</summary>
  549. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  550. public static uint shuffle(uint2 a, uint2 b, ShuffleComponent x)
  551. {
  552. return select_shuffle_component(a, b, x);
  553. }
  554. /// <summary>Returns the result of specified shuffling of the components from two uint2 vectors into a uint2 vector.</summary>
  555. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  556. public static uint2 shuffle(uint2 a, uint2 b, ShuffleComponent x, ShuffleComponent y)
  557. {
  558. return uint2(
  559. select_shuffle_component(a, b, x),
  560. select_shuffle_component(a, b, y));
  561. }
  562. /// <summary>Returns the result of specified shuffling of the components from two uint2 vectors into a uint3 vector.</summary>
  563. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  564. public static uint3 shuffle(uint2 a, uint2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
  565. {
  566. return uint3(
  567. select_shuffle_component(a, b, x),
  568. select_shuffle_component(a, b, y),
  569. select_shuffle_component(a, b, z));
  570. }
  571. /// <summary>Returns the result of specified shuffling of the components from two uint2 vectors into a uint4 vector.</summary>
  572. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  573. public static uint4 shuffle(uint2 a, uint2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
  574. {
  575. return uint4(
  576. select_shuffle_component(a, b, x),
  577. select_shuffle_component(a, b, y),
  578. select_shuffle_component(a, b, z),
  579. select_shuffle_component(a, b, w));
  580. }
  581. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  582. internal static uint select_shuffle_component(uint2 a, uint2 b, ShuffleComponent component)
  583. {
  584. switch(component)
  585. {
  586. case ShuffleComponent.LeftX:
  587. return a.x;
  588. case ShuffleComponent.LeftY:
  589. return a.y;
  590. case ShuffleComponent.RightX:
  591. return b.x;
  592. case ShuffleComponent.RightY:
  593. return b.y;
  594. default:
  595. throw new System.ArgumentException("Invalid shuffle component: " + component);
  596. }
  597. }
  598. }
  599. }