int3x2.gen.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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. #pragma warning disable 0660, 0661
  12. namespace Unity.Mathematics
  13. {
  14. [System.Serializable]
  15. public partial struct int3x2 : System.IEquatable<int3x2>, IFormattable
  16. {
  17. public int3 c0;
  18. public int3 c1;
  19. /// <summary>int3x2 zero value.</summary>
  20. public static readonly int3x2 zero;
  21. /// <summary>Constructs a int3x2 matrix from two int3 vectors.</summary>
  22. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  23. public int3x2(int3 c0, int3 c1)
  24. {
  25. this.c0 = c0;
  26. this.c1 = c1;
  27. }
  28. /// <summary>Constructs a int3x2 matrix from 6 int values given in row-major order.</summary>
  29. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  30. public int3x2(int m00, int m01,
  31. int m10, int m11,
  32. int m20, int m21)
  33. {
  34. this.c0 = new int3(m00, m10, m20);
  35. this.c1 = new int3(m01, m11, m21);
  36. }
  37. /// <summary>Constructs a int3x2 matrix from a single int value by assigning it to every component.</summary>
  38. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  39. public int3x2(int v)
  40. {
  41. this.c0 = v;
  42. this.c1 = v;
  43. }
  44. /// <summary>Constructs a int3x2 matrix from a single bool value by converting it to int and assigning it to every component.</summary>
  45. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  46. public int3x2(bool v)
  47. {
  48. this.c0 = math.select(new int3(0), new int3(1), v);
  49. this.c1 = math.select(new int3(0), new int3(1), v);
  50. }
  51. /// <summary>Constructs a int3x2 matrix from a bool3x2 matrix by componentwise conversion.</summary>
  52. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  53. public int3x2(bool3x2 v)
  54. {
  55. this.c0 = math.select(new int3(0), new int3(1), v.c0);
  56. this.c1 = math.select(new int3(0), new int3(1), v.c1);
  57. }
  58. /// <summary>Constructs a int3x2 matrix from a single uint value by converting it to int and assigning it to every component.</summary>
  59. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  60. public int3x2(uint v)
  61. {
  62. this.c0 = (int3)v;
  63. this.c1 = (int3)v;
  64. }
  65. /// <summary>Constructs a int3x2 matrix from a uint3x2 matrix by componentwise conversion.</summary>
  66. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  67. public int3x2(uint3x2 v)
  68. {
  69. this.c0 = (int3)v.c0;
  70. this.c1 = (int3)v.c1;
  71. }
  72. /// <summary>Constructs a int3x2 matrix from a single float value by converting it to int and assigning it to every component.</summary>
  73. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  74. public int3x2(float v)
  75. {
  76. this.c0 = (int3)v;
  77. this.c1 = (int3)v;
  78. }
  79. /// <summary>Constructs a int3x2 matrix from a float3x2 matrix by componentwise conversion.</summary>
  80. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  81. public int3x2(float3x2 v)
  82. {
  83. this.c0 = (int3)v.c0;
  84. this.c1 = (int3)v.c1;
  85. }
  86. /// <summary>Constructs a int3x2 matrix from a single double value by converting it to int and assigning it to every component.</summary>
  87. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  88. public int3x2(double v)
  89. {
  90. this.c0 = (int3)v;
  91. this.c1 = (int3)v;
  92. }
  93. /// <summary>Constructs a int3x2 matrix from a double3x2 matrix by componentwise conversion.</summary>
  94. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  95. public int3x2(double3x2 v)
  96. {
  97. this.c0 = (int3)v.c0;
  98. this.c1 = (int3)v.c1;
  99. }
  100. /// <summary>Implicitly converts a single int value to a int3x2 matrix by assigning it to every component.</summary>
  101. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  102. public static implicit operator int3x2(int v) { return new int3x2(v); }
  103. /// <summary>Explicitly converts a single bool value to a int3x2 matrix by converting it to int and assigning it to every component.</summary>
  104. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  105. public static explicit operator int3x2(bool v) { return new int3x2(v); }
  106. /// <summary>Explicitly converts a bool3x2 matrix to a int3x2 matrix by componentwise conversion.</summary>
  107. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  108. public static explicit operator int3x2(bool3x2 v) { return new int3x2(v); }
  109. /// <summary>Explicitly converts a single uint value to a int3x2 matrix by converting it to int and assigning it to every component.</summary>
  110. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  111. public static explicit operator int3x2(uint v) { return new int3x2(v); }
  112. /// <summary>Explicitly converts a uint3x2 matrix to a int3x2 matrix by componentwise conversion.</summary>
  113. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  114. public static explicit operator int3x2(uint3x2 v) { return new int3x2(v); }
  115. /// <summary>Explicitly converts a single float value to a int3x2 matrix by converting it to int and assigning it to every component.</summary>
  116. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  117. public static explicit operator int3x2(float v) { return new int3x2(v); }
  118. /// <summary>Explicitly converts a float3x2 matrix to a int3x2 matrix by componentwise conversion.</summary>
  119. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  120. public static explicit operator int3x2(float3x2 v) { return new int3x2(v); }
  121. /// <summary>Explicitly converts a single double value to a int3x2 matrix by converting it to int and assigning it to every component.</summary>
  122. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  123. public static explicit operator int3x2(double v) { return new int3x2(v); }
  124. /// <summary>Explicitly converts a double3x2 matrix to a int3x2 matrix by componentwise conversion.</summary>
  125. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  126. public static explicit operator int3x2(double3x2 v) { return new int3x2(v); }
  127. /// <summary>Returns the result of a componentwise multiplication operation on two int3x2 matrices.</summary>
  128. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  129. public static int3x2 operator * (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
  130. /// <summary>Returns the result of a componentwise multiplication operation on an int3x2 matrix and an int value.</summary>
  131. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  132. public static int3x2 operator * (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
  133. /// <summary>Returns the result of a componentwise multiplication operation on an int value and an int3x2 matrix.</summary>
  134. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  135. public static int3x2 operator * (int lhs, int3x2 rhs) { return new int3x2 (lhs * rhs.c0, lhs * rhs.c1); }
  136. /// <summary>Returns the result of a componentwise addition operation on two int3x2 matrices.</summary>
  137. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  138. public static int3x2 operator + (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
  139. /// <summary>Returns the result of a componentwise addition operation on an int3x2 matrix and an int value.</summary>
  140. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  141. public static int3x2 operator + (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
  142. /// <summary>Returns the result of a componentwise addition operation on an int value and an int3x2 matrix.</summary>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public static int3x2 operator + (int lhs, int3x2 rhs) { return new int3x2 (lhs + rhs.c0, lhs + rhs.c1); }
  145. /// <summary>Returns the result of a componentwise subtraction operation on two int3x2 matrices.</summary>
  146. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  147. public static int3x2 operator - (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
  148. /// <summary>Returns the result of a componentwise subtraction operation on an int3x2 matrix and an int value.</summary>
  149. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  150. public static int3x2 operator - (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
  151. /// <summary>Returns the result of a componentwise subtraction operation on an int value and an int3x2 matrix.</summary>
  152. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  153. public static int3x2 operator - (int lhs, int3x2 rhs) { return new int3x2 (lhs - rhs.c0, lhs - rhs.c1); }
  154. /// <summary>Returns the result of a componentwise division operation on two int3x2 matrices.</summary>
  155. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  156. public static int3x2 operator / (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
  157. /// <summary>Returns the result of a componentwise division operation on an int3x2 matrix and an int value.</summary>
  158. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  159. public static int3x2 operator / (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
  160. /// <summary>Returns the result of a componentwise division operation on an int value and an int3x2 matrix.</summary>
  161. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  162. public static int3x2 operator / (int lhs, int3x2 rhs) { return new int3x2 (lhs / rhs.c0, lhs / rhs.c1); }
  163. /// <summary>Returns the result of a componentwise modulus operation on two int3x2 matrices.</summary>
  164. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  165. public static int3x2 operator % (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
  166. /// <summary>Returns the result of a componentwise modulus operation on an int3x2 matrix and an int value.</summary>
  167. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  168. public static int3x2 operator % (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
  169. /// <summary>Returns the result of a componentwise modulus operation on an int value and an int3x2 matrix.</summary>
  170. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  171. public static int3x2 operator % (int lhs, int3x2 rhs) { return new int3x2 (lhs % rhs.c0, lhs % rhs.c1); }
  172. /// <summary>Returns the result of a componentwise increment operation on an int3x2 matrix.</summary>
  173. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  174. public static int3x2 operator ++ (int3x2 val) { return new int3x2 (++val.c0, ++val.c1); }
  175. /// <summary>Returns the result of a componentwise decrement operation on an int3x2 matrix.</summary>
  176. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  177. public static int3x2 operator -- (int3x2 val) { return new int3x2 (--val.c0, --val.c1); }
  178. /// <summary>Returns the result of a componentwise less than operation on two int3x2 matrices.</summary>
  179. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  180. public static bool3x2 operator < (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
  181. /// <summary>Returns the result of a componentwise less than operation on an int3x2 matrix and an int value.</summary>
  182. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  183. public static bool3x2 operator < (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
  184. /// <summary>Returns the result of a componentwise less than operation on an int value and an int3x2 matrix.</summary>
  185. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  186. public static bool3x2 operator < (int lhs, int3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); }
  187. /// <summary>Returns the result of a componentwise less or equal operation on two int3x2 matrices.</summary>
  188. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  189. public static bool3x2 operator <= (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
  190. /// <summary>Returns the result of a componentwise less or equal operation on an int3x2 matrix and an int value.</summary>
  191. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  192. public static bool3x2 operator <= (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
  193. /// <summary>Returns the result of a componentwise less or equal operation on an int value and an int3x2 matrix.</summary>
  194. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  195. public static bool3x2 operator <= (int lhs, int3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
  196. /// <summary>Returns the result of a componentwise greater than operation on two int3x2 matrices.</summary>
  197. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  198. public static bool3x2 operator > (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
  199. /// <summary>Returns the result of a componentwise greater than operation on an int3x2 matrix and an int value.</summary>
  200. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  201. public static bool3x2 operator > (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
  202. /// <summary>Returns the result of a componentwise greater than operation on an int value and an int3x2 matrix.</summary>
  203. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  204. public static bool3x2 operator > (int lhs, int3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); }
  205. /// <summary>Returns the result of a componentwise greater or equal operation on two int3x2 matrices.</summary>
  206. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  207. public static bool3x2 operator >= (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
  208. /// <summary>Returns the result of a componentwise greater or equal operation on an int3x2 matrix and an int value.</summary>
  209. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  210. public static bool3x2 operator >= (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
  211. /// <summary>Returns the result of a componentwise greater or equal operation on an int value and an int3x2 matrix.</summary>
  212. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  213. public static bool3x2 operator >= (int lhs, int3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
  214. /// <summary>Returns the result of a componentwise unary minus operation on an int3x2 matrix.</summary>
  215. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  216. public static int3x2 operator - (int3x2 val) { return new int3x2 (-val.c0, -val.c1); }
  217. /// <summary>Returns the result of a componentwise unary plus operation on an int3x2 matrix.</summary>
  218. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  219. public static int3x2 operator + (int3x2 val) { return new int3x2 (+val.c0, +val.c1); }
  220. /// <summary>Returns the result of a componentwise left shift operation on an int3x2 matrix by a number of bits specified by a single int.</summary>
  221. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  222. public static int3x2 operator << (int3x2 x, int n) { return new int3x2 (x.c0 << n, x.c1 << n); }
  223. /// <summary>Returns the result of a componentwise right shift operation on an int3x2 matrix by a number of bits specified by a single int.</summary>
  224. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  225. public static int3x2 operator >> (int3x2 x, int n) { return new int3x2 (x.c0 >> n, x.c1 >> n); }
  226. /// <summary>Returns the result of a componentwise equality operation on two int3x2 matrices.</summary>
  227. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  228. public static bool3x2 operator == (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
  229. /// <summary>Returns the result of a componentwise equality operation on an int3x2 matrix and an int value.</summary>
  230. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  231. public static bool3x2 operator == (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
  232. /// <summary>Returns the result of a componentwise equality operation on an int value and an int3x2 matrix.</summary>
  233. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  234. public static bool3x2 operator == (int lhs, int3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); }
  235. /// <summary>Returns the result of a componentwise not equal operation on two int3x2 matrices.</summary>
  236. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  237. public static bool3x2 operator != (int3x2 lhs, int3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
  238. /// <summary>Returns the result of a componentwise not equal operation on an int3x2 matrix and an int value.</summary>
  239. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  240. public static bool3x2 operator != (int3x2 lhs, int rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
  241. /// <summary>Returns the result of a componentwise not equal operation on an int value and an int3x2 matrix.</summary>
  242. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  243. public static bool3x2 operator != (int lhs, int3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); }
  244. /// <summary>Returns the result of a componentwise bitwise not operation on an int3x2 matrix.</summary>
  245. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  246. public static int3x2 operator ~ (int3x2 val) { return new int3x2 (~val.c0, ~val.c1); }
  247. /// <summary>Returns the result of a componentwise bitwise and operation on two int3x2 matrices.</summary>
  248. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  249. public static int3x2 operator & (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1); }
  250. /// <summary>Returns the result of a componentwise bitwise and operation on an int3x2 matrix and an int value.</summary>
  251. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  252. public static int3x2 operator & (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 & rhs, lhs.c1 & rhs); }
  253. /// <summary>Returns the result of a componentwise bitwise and operation on an int value and an int3x2 matrix.</summary>
  254. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  255. public static int3x2 operator & (int lhs, int3x2 rhs) { return new int3x2 (lhs & rhs.c0, lhs & rhs.c1); }
  256. /// <summary>Returns the result of a componentwise bitwise or operation on two int3x2 matrices.</summary>
  257. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  258. public static int3x2 operator | (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1); }
  259. /// <summary>Returns the result of a componentwise bitwise or operation on an int3x2 matrix and an int value.</summary>
  260. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  261. public static int3x2 operator | (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 | rhs, lhs.c1 | rhs); }
  262. /// <summary>Returns the result of a componentwise bitwise or operation on an int value and an int3x2 matrix.</summary>
  263. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  264. public static int3x2 operator | (int lhs, int3x2 rhs) { return new int3x2 (lhs | rhs.c0, lhs | rhs.c1); }
  265. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two int3x2 matrices.</summary>
  266. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  267. public static int3x2 operator ^ (int3x2 lhs, int3x2 rhs) { return new int3x2 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1); }
  268. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int3x2 matrix and an int value.</summary>
  269. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  270. public static int3x2 operator ^ (int3x2 lhs, int rhs) { return new int3x2 (lhs.c0 ^ rhs, lhs.c1 ^ rhs); }
  271. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on an int value and an int3x2 matrix.</summary>
  272. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  273. public static int3x2 operator ^ (int lhs, int3x2 rhs) { return new int3x2 (lhs ^ rhs.c0, lhs ^ rhs.c1); }
  274. /// <summary>Returns the int3 element at a specified index.</summary>
  275. unsafe public ref int3 this[int index]
  276. {
  277. get
  278. {
  279. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  280. if ((uint)index >= 2)
  281. throw new System.ArgumentException("index must be between[0...1]");
  282. #endif
  283. fixed (int3x2* array = &this) { return ref ((int3*)array)[index]; }
  284. }
  285. }
  286. /// <summary>Returns true if the int3x2 is equal to a given int3x2, false otherwise.</summary>
  287. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  288. public bool Equals(int3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
  289. /// <summary>Returns true if the int3x2 is equal to a given int3x2, false otherwise.</summary>
  290. public override bool Equals(object o) { return Equals((int3x2)o); }
  291. /// <summary>Returns a hash code for the int3x2.</summary>
  292. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  293. public override int GetHashCode() { return (int)math.hash(this); }
  294. /// <summary>Returns a string representation of the int3x2.</summary>
  295. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  296. public override string ToString()
  297. {
  298. return string.Format("int3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z);
  299. }
  300. /// <summary>Returns a string representation of the int3x2 using a specified format and culture-specific format information.</summary>
  301. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  302. public string ToString(string format, IFormatProvider formatProvider)
  303. {
  304. return string.Format("int3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider));
  305. }
  306. }
  307. public static partial class math
  308. {
  309. /// <summary>Returns a int3x2 matrix constructed from two int3 vectors.</summary>
  310. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  311. public static int3x2 int3x2(int3 c0, int3 c1) { return new int3x2(c0, c1); }
  312. /// <summary>Returns a int3x2 matrix constructed from from 6 int values given in row-major order.</summary>
  313. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  314. public static int3x2 int3x2(int m00, int m01,
  315. int m10, int m11,
  316. int m20, int m21)
  317. {
  318. return new int3x2(m00, m01,
  319. m10, m11,
  320. m20, m21);
  321. }
  322. /// <summary>Returns a int3x2 matrix constructed from a single int value by assigning it to every component.</summary>
  323. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  324. public static int3x2 int3x2(int v) { return new int3x2(v); }
  325. /// <summary>Returns a int3x2 matrix constructed from a single bool value by converting it to int and assigning it to every component.</summary>
  326. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  327. public static int3x2 int3x2(bool v) { return new int3x2(v); }
  328. /// <summary>Return a int3x2 matrix constructed from a bool3x2 matrix by componentwise conversion.</summary>
  329. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  330. public static int3x2 int3x2(bool3x2 v) { return new int3x2(v); }
  331. /// <summary>Returns a int3x2 matrix constructed from a single uint value by converting it to int and assigning it to every component.</summary>
  332. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  333. public static int3x2 int3x2(uint v) { return new int3x2(v); }
  334. /// <summary>Return a int3x2 matrix constructed from a uint3x2 matrix by componentwise conversion.</summary>
  335. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  336. public static int3x2 int3x2(uint3x2 v) { return new int3x2(v); }
  337. /// <summary>Returns a int3x2 matrix constructed from a single float value by converting it to int and assigning it to every component.</summary>
  338. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  339. public static int3x2 int3x2(float v) { return new int3x2(v); }
  340. /// <summary>Return a int3x2 matrix constructed from a float3x2 matrix by componentwise conversion.</summary>
  341. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  342. public static int3x2 int3x2(float3x2 v) { return new int3x2(v); }
  343. /// <summary>Returns a int3x2 matrix constructed from a single double value by converting it to int and assigning it to every component.</summary>
  344. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  345. public static int3x2 int3x2(double v) { return new int3x2(v); }
  346. /// <summary>Return a int3x2 matrix constructed from a double3x2 matrix by componentwise conversion.</summary>
  347. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  348. public static int3x2 int3x2(double3x2 v) { return new int3x2(v); }
  349. /// <summary>Return the int2x3 transpose of a int3x2 matrix.</summary>
  350. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  351. public static int2x3 transpose(int3x2 v)
  352. {
  353. return int2x3(
  354. v.c0.x, v.c0.y, v.c0.z,
  355. v.c1.x, v.c1.y, v.c1.z);
  356. }
  357. /// <summary>Returns a uint hash code of a int3x2 vector.</summary>
  358. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  359. public static uint hash(int3x2 v)
  360. {
  361. return csum(asuint(v.c0) * uint3(0xDB3DE101u, 0x7B6D1B4Bu, 0x58399E77u) +
  362. asuint(v.c1) * uint3(0x5EAC29C9u, 0xFC6014F9u, 0x6BF6693Fu)) + 0x9D1B1D9Bu;
  363. }
  364. /// <summary>
  365. /// Returns a uint3 vector hash code of a int3x2 vector.
  366. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  367. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  368. /// </summary>
  369. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  370. public static uint3 hashwide(int3x2 v)
  371. {
  372. return (asuint(v.c0) * uint3(0xF842F5C1u, 0xA47EC335u, 0xA477DF57u) +
  373. asuint(v.c1) * uint3(0xC4B1493Fu, 0xBA0966D3u, 0xAFBEE253u)) + 0x5B419C01u;
  374. }
  375. }
  376. }