Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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 2x4 matrix of bools.</summary>
  16. [System.Serializable]
  17. [Il2CppEagerStaticClassConstruction]
  18. public partial struct bool2x4 : System.IEquatable<bool2x4>
  19. {
  20. /// <summary>Column 0 of the matrix.</summary>
  21. public bool2 c0;
  22. /// <summary>Column 1 of the matrix.</summary>
  23. public bool2 c1;
  24. /// <summary>Column 2 of the matrix.</summary>
  25. public bool2 c2;
  26. /// <summary>Column 3 of the matrix.</summary>
  27. public bool2 c3;
  28. /// <summary>Constructs a bool2x4 matrix from four bool2 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. /// <param name="c3">The matrix column c3 will be set to this value.</param>
  33. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  34. public bool2x4(bool2 c0, bool2 c1, bool2 c2, bool2 c3)
  35. {
  36. this.c0 = c0;
  37. this.c1 = c1;
  38. this.c2 = c2;
  39. this.c3 = c3;
  40. }
  41. /// <summary>Constructs a bool2x4 matrix from 8 bool values given in row-major order.</summary>
  42. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  43. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  44. /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
  45. /// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
  46. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  47. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  48. /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
  49. /// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
  50. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  51. public bool2x4(bool m00, bool m01, bool m02, bool m03,
  52. bool m10, bool m11, bool m12, bool m13)
  53. {
  54. this.c0 = new bool2(m00, m10);
  55. this.c1 = new bool2(m01, m11);
  56. this.c2 = new bool2(m02, m12);
  57. this.c3 = new bool2(m03, m13);
  58. }
  59. /// <summary>Constructs a bool2x4 matrix from a single bool value by assigning it to every component.</summary>
  60. /// <param name="v">bool to convert to bool2x4</param>
  61. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  62. public bool2x4(bool v)
  63. {
  64. this.c0 = v;
  65. this.c1 = v;
  66. this.c2 = v;
  67. this.c3 = v;
  68. }
  69. /// <summary>Implicitly converts a single bool value to a bool2x4 matrix by assigning it to every component.</summary>
  70. /// <param name="v">bool to convert to bool2x4</param>
  71. /// <returns>Converted value.</returns>
  72. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  73. public static implicit operator bool2x4(bool v) { return new bool2x4(v); }
  74. /// <summary>Returns the result of a componentwise equality operation on two bool2x4 matrices.</summary>
  75. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise equality.</param>
  76. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise equality.</param>
  77. /// <returns>bool2x4 result of the componentwise equality.</returns>
  78. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  79. public static bool2x4 operator == (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
  80. /// <summary>Returns the result of a componentwise equality operation on a bool2x4 matrix and a bool value.</summary>
  81. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise equality.</param>
  82. /// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
  83. /// <returns>bool2x4 result of the componentwise equality.</returns>
  84. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  85. public static bool2x4 operator == (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
  86. /// <summary>Returns the result of a componentwise equality operation on a bool value and a bool2x4 matrix.</summary>
  87. /// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
  88. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise equality.</param>
  89. /// <returns>bool2x4 result of the componentwise equality.</returns>
  90. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  91. public static bool2x4 operator == (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
  92. /// <summary>Returns the result of a componentwise not equal operation on two bool2x4 matrices.</summary>
  93. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise not equal.</param>
  94. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise not equal.</param>
  95. /// <returns>bool2x4 result of the componentwise not equal.</returns>
  96. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  97. public static bool2x4 operator != (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
  98. /// <summary>Returns the result of a componentwise not equal operation on a bool2x4 matrix and a bool value.</summary>
  99. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise not equal.</param>
  100. /// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
  101. /// <returns>bool2x4 result of the componentwise not equal.</returns>
  102. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  103. public static bool2x4 operator != (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
  104. /// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool2x4 matrix.</summary>
  105. /// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
  106. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise not equal.</param>
  107. /// <returns>bool2x4 result of the componentwise not equal.</returns>
  108. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  109. public static bool2x4 operator != (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
  110. /// <summary>Returns the result of a componentwise not operation on a bool2x4 matrix.</summary>
  111. /// <param name="val">Value to use when computing the componentwise not.</param>
  112. /// <returns>bool2x4 result of the componentwise not.</returns>
  113. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  114. public static bool2x4 operator ! (bool2x4 val) { return new bool2x4 (!val.c0, !val.c1, !val.c2, !val.c3); }
  115. /// <summary>Returns the result of a componentwise bitwise and operation on two bool2x4 matrices.</summary>
  116. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise and.</param>
  117. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise and.</param>
  118. /// <returns>bool2x4 result of the componentwise bitwise and.</returns>
  119. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  120. public static bool2x4 operator & (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); }
  121. /// <summary>Returns the result of a componentwise bitwise and operation on a bool2x4 matrix and a bool value.</summary>
  122. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise and.</param>
  123. /// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
  124. /// <returns>bool2x4 result of the componentwise bitwise and.</returns>
  125. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  126. public static bool2x4 operator & (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
  127. /// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool2x4 matrix.</summary>
  128. /// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
  129. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise and.</param>
  130. /// <returns>bool2x4 result of the componentwise bitwise and.</returns>
  131. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  132. public static bool2x4 operator & (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
  133. /// <summary>Returns the result of a componentwise bitwise or operation on two bool2x4 matrices.</summary>
  134. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise or.</param>
  135. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise or.</param>
  136. /// <returns>bool2x4 result of the componentwise bitwise or.</returns>
  137. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  138. public static bool2x4 operator | (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); }
  139. /// <summary>Returns the result of a componentwise bitwise or operation on a bool2x4 matrix and a bool value.</summary>
  140. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise or.</param>
  141. /// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
  142. /// <returns>bool2x4 result of the componentwise bitwise or.</returns>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public static bool2x4 operator | (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
  145. /// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool2x4 matrix.</summary>
  146. /// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
  147. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise or.</param>
  148. /// <returns>bool2x4 result of the componentwise bitwise or.</returns>
  149. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  150. public static bool2x4 operator | (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
  151. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool2x4 matrices.</summary>
  152. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise exclusive or.</param>
  153. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise exclusive or.</param>
  154. /// <returns>bool2x4 result of the componentwise bitwise exclusive or.</returns>
  155. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  156. public static bool2x4 operator ^ (bool2x4 lhs, bool2x4 rhs) { return new bool2x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); }
  157. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool2x4 matrix and a bool value.</summary>
  158. /// <param name="lhs">Left hand side bool2x4 to use to compute componentwise bitwise exclusive or.</param>
  159. /// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
  160. /// <returns>bool2x4 result of the componentwise bitwise exclusive or.</returns>
  161. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  162. public static bool2x4 operator ^ (bool2x4 lhs, bool rhs) { return new bool2x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
  163. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2x4 matrix.</summary>
  164. /// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
  165. /// <param name="rhs">Right hand side bool2x4 to use to compute componentwise bitwise exclusive or.</param>
  166. /// <returns>bool2x4 result of the componentwise bitwise exclusive or.</returns>
  167. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  168. public static bool2x4 operator ^ (bool lhs, bool2x4 rhs) { return new bool2x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
  169. /// <summary>Returns the bool2 element at a specified index.</summary>
  170. unsafe public ref bool2 this[int index]
  171. {
  172. get
  173. {
  174. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  175. if ((uint)index >= 4)
  176. throw new System.ArgumentException("index must be between[0...3]");
  177. #endif
  178. fixed (bool2x4* array = &this) { return ref ((bool2*)array)[index]; }
  179. }
  180. }
  181. /// <summary>Returns true if the bool2x4 is equal to a given bool2x4, false otherwise.</summary>
  182. /// <param name="rhs">Right hand side argument to compare equality with.</param>
  183. /// <returns>The result of the equality comparison.</returns>
  184. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  185. public bool Equals(bool2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
  186. /// <summary>Returns true if the bool2x4 is equal to a given bool2x4, false otherwise.</summary>
  187. /// <param name="o">Right hand side argument to compare equality with.</param>
  188. /// <returns>The result of the equality comparison.</returns>
  189. public override bool Equals(object o) { return o is bool2x4 converted && Equals(converted); }
  190. /// <summary>Returns a hash code for the bool2x4.</summary>
  191. /// <returns>The computed hash code.</returns>
  192. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  193. public override int GetHashCode() { return (int)math.hash(this); }
  194. /// <summary>Returns a string representation of the bool2x4.</summary>
  195. /// <returns>String representation of the value.</returns>
  196. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  197. public override string ToString()
  198. {
  199. return string.Format("bool2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y);
  200. }
  201. }
  202. public static partial class math
  203. {
  204. /// <summary>Returns a bool2x4 matrix constructed from four bool2 vectors.</summary>
  205. /// <param name="c0">The matrix column c0 will be set to this value.</param>
  206. /// <param name="c1">The matrix column c1 will be set to this value.</param>
  207. /// <param name="c2">The matrix column c2 will be set to this value.</param>
  208. /// <param name="c3">The matrix column c3 will be set to this value.</param>
  209. /// <returns>bool2x4 constructed from arguments.</returns>
  210. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  211. public static bool2x4 bool2x4(bool2 c0, bool2 c1, bool2 c2, bool2 c3) { return new bool2x4(c0, c1, c2, c3); }
  212. /// <summary>Returns a bool2x4 matrix constructed from from 8 bool values given in row-major order.</summary>
  213. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  214. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  215. /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
  216. /// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
  217. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  218. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  219. /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
  220. /// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
  221. /// <returns>bool2x4 constructed from arguments.</returns>
  222. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  223. public static bool2x4 bool2x4(bool m00, bool m01, bool m02, bool m03,
  224. bool m10, bool m11, bool m12, bool m13)
  225. {
  226. return new bool2x4(m00, m01, m02, m03,
  227. m10, m11, m12, m13);
  228. }
  229. /// <summary>Returns a bool2x4 matrix constructed from a single bool value by assigning it to every component.</summary>
  230. /// <param name="v">bool to convert to bool2x4</param>
  231. /// <returns>Converted value.</returns>
  232. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  233. public static bool2x4 bool2x4(bool v) { return new bool2x4(v); }
  234. /// <summary>Return the bool4x2 transpose of a bool2x4 matrix.</summary>
  235. /// <param name="v">Value to transpose.</param>
  236. /// <returns>Transposed value.</returns>
  237. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  238. public static bool4x2 transpose(bool2x4 v)
  239. {
  240. return bool4x2(
  241. v.c0.x, v.c0.y,
  242. v.c1.x, v.c1.y,
  243. v.c2.x, v.c2.y,
  244. v.c3.x, v.c3.y);
  245. }
  246. /// <summary>Returns a uint hash code of a bool2x4 matrix.</summary>
  247. /// <param name="v">Matrix value to hash.</param>
  248. /// <returns>uint hash of the argument.</returns>
  249. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  250. public static uint hash(bool2x4 v)
  251. {
  252. return csum(select(uint2(0x45A22087u, 0xFC104C3Bu), uint2(0x5FFF6B19u, 0x5E6CBF3Bu), v.c0) +
  253. select(uint2(0xB546F2A5u, 0xBBCF63E7u), uint2(0xC53F4755u, 0x6985C229u), v.c1) +
  254. select(uint2(0xE133B0B3u, 0xC3E0A3B9u), uint2(0xFE31134Fu, 0x712A34D7u), v.c2) +
  255. select(uint2(0x9D77A59Bu, 0x4942CA39u), uint2(0xB40EC62Du, 0x565ED63Fu), v.c3));
  256. }
  257. /// <summary>
  258. /// Returns a uint2 vector hash code of a bool2x4 matrix.
  259. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  260. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  261. /// </summary>
  262. /// <param name="v">Matrix value to hash.</param>
  263. /// <returns>uint2 hash of the argument.</returns>
  264. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  265. public static uint2 hashwide(bool2x4 v)
  266. {
  267. return (select(uint2(0x93C30C2Bu, 0xDCAF0351u), uint2(0x6E050B01u, 0x750FDBF5u), v.c0) +
  268. select(uint2(0x7F3DD499u, 0x52EAAEBBu), uint2(0x4599C793u, 0x83B5E729u), v.c1) +
  269. select(uint2(0xC267163Fu, 0x67BC9149u), uint2(0xAD7C5EC1u, 0x822A7D6Du), v.c2) +
  270. select(uint2(0xB492BF15u, 0xD37220E3u), uint2(0x7AA2C2BDu, 0xE16BC89Du), v.c3));
  271. }
  272. }
  273. }