Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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