Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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 3x4 matrix of bools.</summary>
  16. [System.Serializable]
  17. [Il2CppEagerStaticClassConstruction]
  18. public partial struct bool3x4 : System.IEquatable<bool3x4>
  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>Column 2 of the matrix.</summary>
  25. public bool3 c2;
  26. /// <summary>Column 3 of the matrix.</summary>
  27. public bool3 c3;
  28. /// <summary>Constructs a bool3x4 matrix from four bool3 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 bool3x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3)
  35. {
  36. this.c0 = c0;
  37. this.c1 = c1;
  38. this.c2 = c2;
  39. this.c3 = c3;
  40. }
  41. /// <summary>Constructs a bool3x4 matrix from 12 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. /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
  51. /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
  52. /// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
  53. /// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
  54. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  55. public bool3x4(bool m00, bool m01, bool m02, bool m03,
  56. bool m10, bool m11, bool m12, bool m13,
  57. bool m20, bool m21, bool m22, bool m23)
  58. {
  59. this.c0 = new bool3(m00, m10, m20);
  60. this.c1 = new bool3(m01, m11, m21);
  61. this.c2 = new bool3(m02, m12, m22);
  62. this.c3 = new bool3(m03, m13, m23);
  63. }
  64. /// <summary>Constructs a bool3x4 matrix from a single bool value by assigning it to every component.</summary>
  65. /// <param name="v">bool to convert to bool3x4</param>
  66. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  67. public bool3x4(bool v)
  68. {
  69. this.c0 = v;
  70. this.c1 = v;
  71. this.c2 = v;
  72. this.c3 = v;
  73. }
  74. /// <summary>Implicitly converts a single bool value to a bool3x4 matrix by assigning it to every component.</summary>
  75. /// <param name="v">bool to convert to bool3x4</param>
  76. /// <returns>Converted value.</returns>
  77. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  78. public static implicit operator bool3x4(bool v) { return new bool3x4(v); }
  79. /// <summary>Returns the result of a componentwise equality operation on two bool3x4 matrices.</summary>
  80. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise equality.</param>
  81. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise equality.</param>
  82. /// <returns>bool3x4 result of the componentwise equality.</returns>
  83. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  84. public static bool3x4 operator == (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
  85. /// <summary>Returns the result of a componentwise equality operation on a bool3x4 matrix and a bool value.</summary>
  86. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise equality.</param>
  87. /// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
  88. /// <returns>bool3x4 result of the componentwise equality.</returns>
  89. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  90. public static bool3x4 operator == (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
  91. /// <summary>Returns the result of a componentwise equality operation on a bool value and a bool3x4 matrix.</summary>
  92. /// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
  93. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise equality.</param>
  94. /// <returns>bool3x4 result of the componentwise equality.</returns>
  95. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  96. public static bool3x4 operator == (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
  97. /// <summary>Returns the result of a componentwise not equal operation on two bool3x4 matrices.</summary>
  98. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise not equal.</param>
  99. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise not equal.</param>
  100. /// <returns>bool3x4 result of the componentwise not equal.</returns>
  101. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  102. public static bool3x4 operator != (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
  103. /// <summary>Returns the result of a componentwise not equal operation on a bool3x4 matrix and a bool value.</summary>
  104. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise not equal.</param>
  105. /// <param name="rhs">Right hand side bool to use to compute componentwise not equal.</param>
  106. /// <returns>bool3x4 result of the componentwise not equal.</returns>
  107. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  108. public static bool3x4 operator != (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
  109. /// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool3x4 matrix.</summary>
  110. /// <param name="lhs">Left hand side bool to use to compute componentwise not equal.</param>
  111. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise not equal.</param>
  112. /// <returns>bool3x4 result of the componentwise not equal.</returns>
  113. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  114. public static bool3x4 operator != (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
  115. /// <summary>Returns the result of a componentwise not operation on a bool3x4 matrix.</summary>
  116. /// <param name="val">Value to use when computing the componentwise not.</param>
  117. /// <returns>bool3x4 result of the componentwise not.</returns>
  118. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  119. public static bool3x4 operator ! (bool3x4 val) { return new bool3x4 (!val.c0, !val.c1, !val.c2, !val.c3); }
  120. /// <summary>Returns the result of a componentwise bitwise and operation on two bool3x4 matrices.</summary>
  121. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise and.</param>
  122. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise and.</param>
  123. /// <returns>bool3x4 result of the componentwise bitwise and.</returns>
  124. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  125. public static bool3x4 operator & (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); }
  126. /// <summary>Returns the result of a componentwise bitwise and operation on a bool3x4 matrix and a bool value.</summary>
  127. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise and.</param>
  128. /// <param name="rhs">Right hand side bool to use to compute componentwise bitwise and.</param>
  129. /// <returns>bool3x4 result of the componentwise bitwise and.</returns>
  130. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  131. public static bool3x4 operator & (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
  132. /// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool3x4 matrix.</summary>
  133. /// <param name="lhs">Left hand side bool to use to compute componentwise bitwise and.</param>
  134. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise and.</param>
  135. /// <returns>bool3x4 result of the componentwise bitwise and.</returns>
  136. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  137. public static bool3x4 operator & (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
  138. /// <summary>Returns the result of a componentwise bitwise or operation on two bool3x4 matrices.</summary>
  139. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise or.</param>
  140. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise or.</param>
  141. /// <returns>bool3x4 result of the componentwise bitwise or.</returns>
  142. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  143. public static bool3x4 operator | (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); }
  144. /// <summary>Returns the result of a componentwise bitwise or operation on a bool3x4 matrix and a bool value.</summary>
  145. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise or.</param>
  146. /// <param name="rhs">Right hand side bool to use to compute componentwise bitwise or.</param>
  147. /// <returns>bool3x4 result of the componentwise bitwise or.</returns>
  148. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  149. public static bool3x4 operator | (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
  150. /// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool3x4 matrix.</summary>
  151. /// <param name="lhs">Left hand side bool to use to compute componentwise bitwise or.</param>
  152. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise or.</param>
  153. /// <returns>bool3x4 result of the componentwise bitwise or.</returns>
  154. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  155. public static bool3x4 operator | (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
  156. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool3x4 matrices.</summary>
  157. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise exclusive or.</param>
  158. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise exclusive or.</param>
  159. /// <returns>bool3x4 result of the componentwise bitwise exclusive or.</returns>
  160. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  161. public static bool3x4 operator ^ (bool3x4 lhs, bool3x4 rhs) { return new bool3x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); }
  162. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool3x4 matrix and a bool value.</summary>
  163. /// <param name="lhs">Left hand side bool3x4 to use to compute componentwise bitwise exclusive or.</param>
  164. /// <param name="rhs">Right hand side bool to use to compute componentwise bitwise exclusive or.</param>
  165. /// <returns>bool3x4 result of the componentwise bitwise exclusive or.</returns>
  166. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  167. public static bool3x4 operator ^ (bool3x4 lhs, bool rhs) { return new bool3x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
  168. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool3x4 matrix.</summary>
  169. /// <param name="lhs">Left hand side bool to use to compute componentwise bitwise exclusive or.</param>
  170. /// <param name="rhs">Right hand side bool3x4 to use to compute componentwise bitwise exclusive or.</param>
  171. /// <returns>bool3x4 result of the componentwise bitwise exclusive or.</returns>
  172. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  173. public static bool3x4 operator ^ (bool lhs, bool3x4 rhs) { return new bool3x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
  174. /// <summary>Returns the bool3 element at a specified index.</summary>
  175. unsafe public ref bool3 this[int index]
  176. {
  177. get
  178. {
  179. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  180. if ((uint)index >= 4)
  181. throw new System.ArgumentException("index must be between[0...3]");
  182. #endif
  183. fixed (bool3x4* array = &this) { return ref ((bool3*)array)[index]; }
  184. }
  185. }
  186. /// <summary>Returns true if the bool3x4 is equal to a given bool3x4, false otherwise.</summary>
  187. /// <param name="rhs">Right hand side argument to compare equality with.</param>
  188. /// <returns>The result of the equality comparison.</returns>
  189. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  190. public bool Equals(bool3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
  191. /// <summary>Returns true if the bool3x4 is equal to a given bool3x4, false otherwise.</summary>
  192. /// <param name="o">Right hand side argument to compare equality with.</param>
  193. /// <returns>The result of the equality comparison.</returns>
  194. public override bool Equals(object o) { return o is bool3x4 converted && Equals(converted); }
  195. /// <summary>Returns a hash code for the bool3x4.</summary>
  196. /// <returns>The computed hash code.</returns>
  197. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  198. public override int GetHashCode() { return (int)math.hash(this); }
  199. /// <summary>Returns a string representation of the bool3x4.</summary>
  200. /// <returns>String representation of the value.</returns>
  201. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  202. public override string ToString()
  203. {
  204. return string.Format("bool3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z);
  205. }
  206. }
  207. public static partial class math
  208. {
  209. /// <summary>Returns a bool3x4 matrix constructed from four bool3 vectors.</summary>
  210. /// <param name="c0">The matrix column c0 will be set to this value.</param>
  211. /// <param name="c1">The matrix column c1 will be set to this value.</param>
  212. /// <param name="c2">The matrix column c2 will be set to this value.</param>
  213. /// <param name="c3">The matrix column c3 will be set to this value.</param>
  214. /// <returns>bool3x4 constructed from arguments.</returns>
  215. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  216. public static bool3x4 bool3x4(bool3 c0, bool3 c1, bool3 c2, bool3 c3) { return new bool3x4(c0, c1, c2, c3); }
  217. /// <summary>Returns a bool3x4 matrix constructed from from 12 bool values given in row-major order.</summary>
  218. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  219. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  220. /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
  221. /// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
  222. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  223. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  224. /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
  225. /// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
  226. /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
  227. /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
  228. /// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
  229. /// <param name="m23">The matrix at row 2, column 3 will be set to this value.</param>
  230. /// <returns>bool3x4 constructed from arguments.</returns>
  231. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  232. public static bool3x4 bool3x4(bool m00, bool m01, bool m02, bool m03,
  233. bool m10, bool m11, bool m12, bool m13,
  234. bool m20, bool m21, bool m22, bool m23)
  235. {
  236. return new bool3x4(m00, m01, m02, m03,
  237. m10, m11, m12, m13,
  238. m20, m21, m22, m23);
  239. }
  240. /// <summary>Returns a bool3x4 matrix constructed from a single bool value by assigning it to every component.</summary>
  241. /// <param name="v">bool to convert to bool3x4</param>
  242. /// <returns>Converted value.</returns>
  243. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  244. public static bool3x4 bool3x4(bool v) { return new bool3x4(v); }
  245. /// <summary>Return the bool4x3 transpose of a bool3x4 matrix.</summary>
  246. /// <param name="v">Value to transpose.</param>
  247. /// <returns>Transposed value.</returns>
  248. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  249. public static bool4x3 transpose(bool3x4 v)
  250. {
  251. return bool4x3(
  252. v.c0.x, v.c0.y, v.c0.z,
  253. v.c1.x, v.c1.y, v.c1.z,
  254. v.c2.x, v.c2.y, v.c2.z,
  255. v.c3.x, v.c3.y, v.c3.z);
  256. }
  257. /// <summary>Returns a uint hash code of a bool3x4 matrix.</summary>
  258. /// <param name="v">Matrix value to hash.</param>
  259. /// <returns>uint hash of the argument.</returns>
  260. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  261. public static uint hash(bool3x4 v)
  262. {
  263. return csum(select(uint3(0x83B58237u, 0x833E3E29u, 0xA9D919BFu), uint3(0xC3EC1D97u, 0xB8B208C7u, 0x5D3ED947u), v.c0) +
  264. select(uint3(0x4473BBB1u, 0xCBA11D5Fu, 0x685835CFu), uint3(0xC3D32AE1u, 0xB966942Fu, 0xFE9856B3u), v.c1) +
  265. select(uint3(0xFA3A3285u, 0xAD55999Du, 0xDCDD5341u), uint3(0x94DDD769u, 0xA1E92D39u, 0x4583C801u), v.c2) +
  266. select(uint3(0x9536A0F5u, 0xAF816615u, 0x9AF8D62Du), uint3(0xE3600729u, 0x5F17300Du, 0x670D6809u), v.c3));
  267. }
  268. /// <summary>
  269. /// Returns a uint3 vector hash code of a bool3x4 matrix.
  270. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  271. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  272. /// </summary>
  273. /// <param name="v">Matrix value to hash.</param>
  274. /// <returns>uint3 hash of the argument.</returns>
  275. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  276. public static uint3 hashwide(bool3x4 v)
  277. {
  278. return (select(uint3(0x7AF32C49u, 0xAE131389u, 0x5D1B165Bu), uint3(0x87096CD7u, 0x4C7F6DD1u, 0x4822A3E9u), v.c0) +
  279. select(uint3(0xAAC3C25Du, 0xD21D0945u, 0x88FCAB2Du), uint3(0x614DA60Du, 0x5BA2C50Bu, 0x8C455ACBu), v.c1) +
  280. select(uint3(0xCD266C89u, 0xF1852A33u, 0x77E35E77u), uint3(0x863E3729u, 0xE191B035u, 0x68586FAFu), v.c2) +
  281. select(uint3(0xD4DFF6D3u, 0xCB634F4Du, 0x9B13B92Du), uint3(0x4ABF0813u, 0x86068063u, 0xD75513F9u), v.c3));
  282. }
  283. }
  284. }