暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

bool3x2.gen.cs 18KB

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