No Description
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.

bool4x3.gen.cs 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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 4x3 matrix of bools.</summary>
  16. [System.Serializable]
  17. [Il2CppEagerStaticClassConstruction]
  18. public partial struct bool4x3 : System.IEquatable<bool4x3>
  19. {
  20. /// <summary>Column 0 of the matrix.</summary>
  21. public bool4 c0;
  22. /// <summary>Column 1 of the matrix.</summary>
  23. public bool4 c1;
  24. /// <summary>Column 2 of the matrix.</summary>
  25. public bool4 c2;
  26. /// <summary>Constructs a bool4x3 matrix from three bool4 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 bool4x3(bool4 c0, bool4 c1, bool4 c2)
  32. {
  33. this.c0 = c0;
  34. this.c1 = c1;
  35. this.c2 = c2;
  36. }
  37. /// <summary>Constructs a bool4x3 matrix from 12 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. /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
  45. /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
  46. /// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
  47. /// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
  48. /// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
  49. /// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
  50. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  51. public bool4x3(bool m00, bool m01, bool m02,
  52. bool m10, bool m11, bool m12,
  53. bool m20, bool m21, bool m22,
  54. bool m30, bool m31, bool m32)
  55. {
  56. this.c0 = new bool4(m00, m10, m20, m30);
  57. this.c1 = new bool4(m01, m11, m21, m31);
  58. this.c2 = new bool4(m02, m12, m22, m32);
  59. }
  60. /// <summary>Constructs a bool4x3 matrix from a single bool value by assigning it to every component.</summary>
  61. /// <param name="v">bool to convert to bool4x3</param>
  62. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  63. public bool4x3(bool v)
  64. {
  65. this.c0 = v;
  66. this.c1 = v;
  67. this.c2 = v;
  68. }
  69. /// <summary>Implicitly converts a single bool value to a bool4x3 matrix by assigning it to every component.</summary>
  70. /// <param name="v">bool to convert to bool4x3</param>
  71. /// <returns>Converted value.</returns>
  72. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  73. public static implicit operator bool4x3(bool v) { return new bool4x3(v); }
  74. /// <summary>Returns the result of a componentwise equality operation on two bool4x3 matrices.</summary>
  75. /// <param name="lhs">Left hand side bool4x3 to use to compute componentwise equality.</param>
  76. /// <param name="rhs">Right hand side bool4x3 to use to compute componentwise equality.</param>
  77. /// <returns>bool4x3 result of the componentwise equality.</returns>
  78. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  79. public static bool4x3 operator == (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2); }
  80. /// <summary>Returns the result of a componentwise equality operation on a bool4x3 matrix and a bool value.</summary>
  81. /// <param name="lhs">Left hand side bool4x3 to use to compute componentwise equality.</param>
  82. /// <param name="rhs">Right hand side bool to use to compute componentwise equality.</param>
  83. /// <returns>bool4x3 result of the componentwise equality.</returns>
  84. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  85. public static bool4x3 operator == (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs); }
  86. /// <summary>Returns the result of a componentwise equality operation on a bool value and a bool4x3 matrix.</summary>
  87. /// <param name="lhs">Left hand side bool to use to compute componentwise equality.</param>
  88. /// <param name="rhs">Right hand side bool4x3 to use to compute componentwise equality.</param>
  89. /// <returns>bool4x3 result of the componentwise equality.</returns>
  90. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  91. public static bool4x3 operator == (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2); }
  92. /// <summary>Returns the result of a componentwise not equal operation on two bool4x3 matrices.</summary>
  93. /// <param name="lhs">Left hand side bool4x3 to use to compute componentwise not equal.</param>
  94. /// <param name="rhs">Right hand side bool4x3 to use to compute componentwise not equal.</param>
  95. /// <returns>bool4x3 result of the componentwise not equal.</returns>
  96. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  97. public static bool4x3 operator != (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2); }
  98. /// <summary>Returns the result of a componentwise not equal operation on a bool4x3 matrix and a bool value.</summary>
  99. /// <param name="lhs">Left hand side bool4x3 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>bool4x3 result of the componentwise not equal.</returns>
  102. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  103. public static bool4x3 operator != (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs); }
  104. /// <summary>Returns the result of a componentwise not equal operation on a bool value and a bool4x3 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 bool4x3 to use to compute componentwise not equal.</param>
  107. /// <returns>bool4x3 result of the componentwise not equal.</returns>
  108. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  109. public static bool4x3 operator != (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2); }
  110. /// <summary>Returns the result of a componentwise not operation on a bool4x3 matrix.</summary>
  111. /// <param name="val">Value to use when computing the componentwise not.</param>
  112. /// <returns>bool4x3 result of the componentwise not.</returns>
  113. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  114. public static bool4x3 operator ! (bool4x3 val) { return new bool4x3 (!val.c0, !val.c1, !val.c2); }
  115. /// <summary>Returns the result of a componentwise bitwise and operation on two bool4x3 matrices.</summary>
  116. /// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise and.</param>
  117. /// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise and.</param>
  118. /// <returns>bool4x3 result of the componentwise bitwise and.</returns>
  119. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  120. public static bool4x3 operator & (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2); }
  121. /// <summary>Returns the result of a componentwise bitwise and operation on a bool4x3 matrix and a bool value.</summary>
  122. /// <param name="lhs">Left hand side bool4x3 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>bool4x3 result of the componentwise bitwise and.</returns>
  125. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  126. public static bool4x3 operator & (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs); }
  127. /// <summary>Returns the result of a componentwise bitwise and operation on a bool value and a bool4x3 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 bool4x3 to use to compute componentwise bitwise and.</param>
  130. /// <returns>bool4x3 result of the componentwise bitwise and.</returns>
  131. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  132. public static bool4x3 operator & (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2); }
  133. /// <summary>Returns the result of a componentwise bitwise or operation on two bool4x3 matrices.</summary>
  134. /// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise or.</param>
  135. /// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise or.</param>
  136. /// <returns>bool4x3 result of the componentwise bitwise or.</returns>
  137. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  138. public static bool4x3 operator | (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2); }
  139. /// <summary>Returns the result of a componentwise bitwise or operation on a bool4x3 matrix and a bool value.</summary>
  140. /// <param name="lhs">Left hand side bool4x3 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>bool4x3 result of the componentwise bitwise or.</returns>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public static bool4x3 operator | (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs); }
  145. /// <summary>Returns the result of a componentwise bitwise or operation on a bool value and a bool4x3 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 bool4x3 to use to compute componentwise bitwise or.</param>
  148. /// <returns>bool4x3 result of the componentwise bitwise or.</returns>
  149. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  150. public static bool4x3 operator | (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2); }
  151. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two bool4x3 matrices.</summary>
  152. /// <param name="lhs">Left hand side bool4x3 to use to compute componentwise bitwise exclusive or.</param>
  153. /// <param name="rhs">Right hand side bool4x3 to use to compute componentwise bitwise exclusive or.</param>
  154. /// <returns>bool4x3 result of the componentwise bitwise exclusive or.</returns>
  155. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  156. public static bool4x3 operator ^ (bool4x3 lhs, bool4x3 rhs) { return new bool4x3 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2); }
  157. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool4x3 matrix and a bool value.</summary>
  158. /// <param name="lhs">Left hand side bool4x3 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>bool4x3 result of the componentwise bitwise exclusive or.</returns>
  161. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  162. public static bool4x3 operator ^ (bool4x3 lhs, bool rhs) { return new bool4x3 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs); }
  163. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool4x3 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 bool4x3 to use to compute componentwise bitwise exclusive or.</param>
  166. /// <returns>bool4x3 result of the componentwise bitwise exclusive or.</returns>
  167. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  168. public static bool4x3 operator ^ (bool lhs, bool4x3 rhs) { return new bool4x3 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2); }
  169. /// <summary>Returns the bool4 element at a specified index.</summary>
  170. unsafe public ref bool4 this[int index]
  171. {
  172. get
  173. {
  174. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  175. if ((uint)index >= 3)
  176. throw new System.ArgumentException("index must be between[0...2]");
  177. #endif
  178. fixed (bool4x3* array = &this) { return ref ((bool4*)array)[index]; }
  179. }
  180. }
  181. /// <summary>Returns true if the bool4x3 is equal to a given bool4x3, 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(bool4x3 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2); }
  186. /// <summary>Returns true if the bool4x3 is equal to a given bool4x3, 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 bool4x3 converted && Equals(converted); }
  190. /// <summary>Returns a hash code for the bool4x3.</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 bool4x3.</summary>
  195. /// <returns>String representation of the value.</returns>
  196. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  197. public override string ToString()
  198. {
  199. return string.Format("bool4x3({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c0.y, c1.y, c2.y, c0.z, c1.z, c2.z, c0.w, c1.w, c2.w);
  200. }
  201. }
  202. public static partial class math
  203. {
  204. /// <summary>Returns a bool4x3 matrix constructed from three bool4 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. /// <returns>bool4x3 constructed from arguments.</returns>
  209. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  210. public static bool4x3 bool4x3(bool4 c0, bool4 c1, bool4 c2) { return new bool4x3(c0, c1, c2); }
  211. /// <summary>Returns a bool4x3 matrix constructed from from 12 bool values given in row-major order.</summary>
  212. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  213. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  214. /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
  215. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  216. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  217. /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
  218. /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
  219. /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
  220. /// <param name="m22">The matrix at row 2, column 2 will be set to this value.</param>
  221. /// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
  222. /// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
  223. /// <param name="m32">The matrix at row 3, column 2 will be set to this value.</param>
  224. /// <returns>bool4x3 constructed from arguments.</returns>
  225. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  226. public static bool4x3 bool4x3(bool m00, bool m01, bool m02,
  227. bool m10, bool m11, bool m12,
  228. bool m20, bool m21, bool m22,
  229. bool m30, bool m31, bool m32)
  230. {
  231. return new bool4x3(m00, m01, m02,
  232. m10, m11, m12,
  233. m20, m21, m22,
  234. m30, m31, m32);
  235. }
  236. /// <summary>Returns a bool4x3 matrix constructed from a single bool value by assigning it to every component.</summary>
  237. /// <param name="v">bool to convert to bool4x3</param>
  238. /// <returns>Converted value.</returns>
  239. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  240. public static bool4x3 bool4x3(bool v) { return new bool4x3(v); }
  241. /// <summary>Return the bool3x4 transpose of a bool4x3 matrix.</summary>
  242. /// <param name="v">Value to transpose.</param>
  243. /// <returns>Transposed value.</returns>
  244. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  245. public static bool3x4 transpose(bool4x3 v)
  246. {
  247. return bool3x4(
  248. v.c0.x, v.c0.y, v.c0.z, v.c0.w,
  249. v.c1.x, v.c1.y, v.c1.z, v.c1.w,
  250. v.c2.x, v.c2.y, v.c2.z, v.c2.w);
  251. }
  252. /// <summary>Returns a uint hash code of a bool4x3 matrix.</summary>
  253. /// <param name="v">Matrix value to hash.</param>
  254. /// <returns>uint hash of the argument.</returns>
  255. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  256. public static uint hash(bool4x3 v)
  257. {
  258. return csum(select(uint4(0xEADF0775u, 0x747A9D7Bu, 0x4111F799u, 0xB5F05AF1u), uint4(0xFD80290Bu, 0x8B65ADB7u, 0xDFF4F563u, 0x7069770Du), v.c0) +
  259. select(uint4(0xD1224537u, 0xE99ED6F3u, 0x48125549u, 0xEEE2123Bu), uint4(0xE3AD9FE5u, 0xCE1CF8BFu, 0x7BE39F3Bu, 0xFAB9913Fu), v.c1) +
  260. select(uint4(0xB4501269u, 0xE04B89FDu, 0xDB3DE101u, 0x7B6D1B4Bu), uint4(0x58399E77u, 0x5EAC29C9u, 0xFC6014F9u, 0x6BF6693Fu), v.c2));
  261. }
  262. /// <summary>
  263. /// Returns a uint4 vector hash code of a bool4x3 matrix.
  264. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  265. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  266. /// </summary>
  267. /// <param name="v">Matrix value to hash.</param>
  268. /// <returns>uint4 hash of the argument.</returns>
  269. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  270. public static uint4 hashwide(bool4x3 v)
  271. {
  272. return (select(uint4(0x9D1B1D9Bu, 0xF842F5C1u, 0xA47EC335u, 0xA477DF57u), uint4(0xC4B1493Fu, 0xBA0966D3u, 0xAFBEE253u, 0x5B419C01u), v.c0) +
  273. select(uint4(0x515D90F5u, 0xEC9F68F3u, 0xF9EA92D5u, 0xC2FAFCB9u), uint4(0x616E9CA1u, 0xC5C5394Bu, 0xCAE78587u, 0x7A1541C9u), v.c1) +
  274. select(uint4(0xF83BD927u, 0x6A243BCBu, 0x509B84C9u, 0x91D13847u), uint4(0x52F7230Fu, 0xCF286E83u, 0xE121E6ADu, 0xC9CA1249u), v.c2));
  275. }
  276. }
  277. }