Нема описа
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.

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