Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

double3x2.gen.cs 40KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  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 doubles.</summary>
  16. [System.Serializable]
  17. [Il2CppEagerStaticClassConstruction]
  18. public partial struct double3x2 : System.IEquatable<double3x2>, IFormattable
  19. {
  20. /// <summary>Column 0 of the matrix.</summary>
  21. public double3 c0;
  22. /// <summary>Column 1 of the matrix.</summary>
  23. public double3 c1;
  24. /// <summary>double3x2 zero value.</summary>
  25. public static readonly double3x2 zero;
  26. /// <summary>Constructs a double3x2 matrix from two double3 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. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  30. public double3x2(double3 c0, double3 c1)
  31. {
  32. this.c0 = c0;
  33. this.c1 = c1;
  34. }
  35. /// <summary>Constructs a double3x2 matrix from 6 double values given in row-major order.</summary>
  36. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  37. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  38. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  39. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  40. /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
  41. /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
  42. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  43. public double3x2(double m00, double m01,
  44. double m10, double m11,
  45. double m20, double m21)
  46. {
  47. this.c0 = new double3(m00, m10, m20);
  48. this.c1 = new double3(m01, m11, m21);
  49. }
  50. /// <summary>Constructs a double3x2 matrix from a single double value by assigning it to every component.</summary>
  51. /// <param name="v">double to convert to double3x2</param>
  52. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  53. public double3x2(double v)
  54. {
  55. this.c0 = v;
  56. this.c1 = v;
  57. }
  58. /// <summary>Constructs a double3x2 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
  59. /// <param name="v">bool to convert to double3x2</param>
  60. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  61. public double3x2(bool v)
  62. {
  63. this.c0 = math.select(new double3(0.0), new double3(1.0), v);
  64. this.c1 = math.select(new double3(0.0), new double3(1.0), v);
  65. }
  66. /// <summary>Constructs a double3x2 matrix from a bool3x2 matrix by componentwise conversion.</summary>
  67. /// <param name="v">bool3x2 to convert to double3x2</param>
  68. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  69. public double3x2(bool3x2 v)
  70. {
  71. this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0);
  72. this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1);
  73. }
  74. /// <summary>Constructs a double3x2 matrix from a single int value by converting it to double and assigning it to every component.</summary>
  75. /// <param name="v">int to convert to double3x2</param>
  76. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  77. public double3x2(int v)
  78. {
  79. this.c0 = v;
  80. this.c1 = v;
  81. }
  82. /// <summary>Constructs a double3x2 matrix from a int3x2 matrix by componentwise conversion.</summary>
  83. /// <param name="v">int3x2 to convert to double3x2</param>
  84. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  85. public double3x2(int3x2 v)
  86. {
  87. this.c0 = v.c0;
  88. this.c1 = v.c1;
  89. }
  90. /// <summary>Constructs a double3x2 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
  91. /// <param name="v">uint to convert to double3x2</param>
  92. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  93. public double3x2(uint v)
  94. {
  95. this.c0 = v;
  96. this.c1 = v;
  97. }
  98. /// <summary>Constructs a double3x2 matrix from a uint3x2 matrix by componentwise conversion.</summary>
  99. /// <param name="v">uint3x2 to convert to double3x2</param>
  100. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  101. public double3x2(uint3x2 v)
  102. {
  103. this.c0 = v.c0;
  104. this.c1 = v.c1;
  105. }
  106. /// <summary>Constructs a double3x2 matrix from a single float value by converting it to double and assigning it to every component.</summary>
  107. /// <param name="v">float to convert to double3x2</param>
  108. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  109. public double3x2(float v)
  110. {
  111. this.c0 = v;
  112. this.c1 = v;
  113. }
  114. /// <summary>Constructs a double3x2 matrix from a float3x2 matrix by componentwise conversion.</summary>
  115. /// <param name="v">float3x2 to convert to double3x2</param>
  116. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  117. public double3x2(float3x2 v)
  118. {
  119. this.c0 = v.c0;
  120. this.c1 = v.c1;
  121. }
  122. /// <summary>Implicitly converts a single double value to a double3x2 matrix by assigning it to every component.</summary>
  123. /// <param name="v">double to convert to double3x2</param>
  124. /// <returns>Converted value.</returns>
  125. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  126. public static implicit operator double3x2(double v) { return new double3x2(v); }
  127. /// <summary>Explicitly converts a single bool value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
  128. /// <param name="v">bool to convert to double3x2</param>
  129. /// <returns>Converted value.</returns>
  130. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  131. public static explicit operator double3x2(bool v) { return new double3x2(v); }
  132. /// <summary>Explicitly converts a bool3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
  133. /// <param name="v">bool3x2 to convert to double3x2</param>
  134. /// <returns>Converted value.</returns>
  135. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  136. public static explicit operator double3x2(bool3x2 v) { return new double3x2(v); }
  137. /// <summary>Implicitly converts a single int value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
  138. /// <param name="v">int to convert to double3x2</param>
  139. /// <returns>Converted value.</returns>
  140. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  141. public static implicit operator double3x2(int v) { return new double3x2(v); }
  142. /// <summary>Implicitly converts a int3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
  143. /// <param name="v">int3x2 to convert to double3x2</param>
  144. /// <returns>Converted value.</returns>
  145. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  146. public static implicit operator double3x2(int3x2 v) { return new double3x2(v); }
  147. /// <summary>Implicitly converts a single uint value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
  148. /// <param name="v">uint to convert to double3x2</param>
  149. /// <returns>Converted value.</returns>
  150. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  151. public static implicit operator double3x2(uint v) { return new double3x2(v); }
  152. /// <summary>Implicitly converts a uint3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
  153. /// <param name="v">uint3x2 to convert to double3x2</param>
  154. /// <returns>Converted value.</returns>
  155. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  156. public static implicit operator double3x2(uint3x2 v) { return new double3x2(v); }
  157. /// <summary>Implicitly converts a single float value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
  158. /// <param name="v">float to convert to double3x2</param>
  159. /// <returns>Converted value.</returns>
  160. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  161. public static implicit operator double3x2(float v) { return new double3x2(v); }
  162. /// <summary>Implicitly converts a float3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
  163. /// <param name="v">float3x2 to convert to double3x2</param>
  164. /// <returns>Converted value.</returns>
  165. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  166. public static implicit operator double3x2(float3x2 v) { return new double3x2(v); }
  167. /// <summary>Returns the result of a componentwise multiplication operation on two double3x2 matrices.</summary>
  168. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise multiplication.</param>
  169. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise multiplication.</param>
  170. /// <returns>double3x2 result of the componentwise multiplication.</returns>
  171. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  172. public static double3x2 operator * (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
  173. /// <summary>Returns the result of a componentwise multiplication operation on a double3x2 matrix and a double value.</summary>
  174. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise multiplication.</param>
  175. /// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
  176. /// <returns>double3x2 result of the componentwise multiplication.</returns>
  177. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  178. public static double3x2 operator * (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
  179. /// <summary>Returns the result of a componentwise multiplication operation on a double value and a double3x2 matrix.</summary>
  180. /// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
  181. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise multiplication.</param>
  182. /// <returns>double3x2 result of the componentwise multiplication.</returns>
  183. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  184. public static double3x2 operator * (double lhs, double3x2 rhs) { return new double3x2 (lhs * rhs.c0, lhs * rhs.c1); }
  185. /// <summary>Returns the result of a componentwise addition operation on two double3x2 matrices.</summary>
  186. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise addition.</param>
  187. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise addition.</param>
  188. /// <returns>double3x2 result of the componentwise addition.</returns>
  189. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  190. public static double3x2 operator + (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
  191. /// <summary>Returns the result of a componentwise addition operation on a double3x2 matrix and a double value.</summary>
  192. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise addition.</param>
  193. /// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
  194. /// <returns>double3x2 result of the componentwise addition.</returns>
  195. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  196. public static double3x2 operator + (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
  197. /// <summary>Returns the result of a componentwise addition operation on a double value and a double3x2 matrix.</summary>
  198. /// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
  199. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise addition.</param>
  200. /// <returns>double3x2 result of the componentwise addition.</returns>
  201. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  202. public static double3x2 operator + (double lhs, double3x2 rhs) { return new double3x2 (lhs + rhs.c0, lhs + rhs.c1); }
  203. /// <summary>Returns the result of a componentwise subtraction operation on two double3x2 matrices.</summary>
  204. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise subtraction.</param>
  205. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise subtraction.</param>
  206. /// <returns>double3x2 result of the componentwise subtraction.</returns>
  207. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  208. public static double3x2 operator - (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
  209. /// <summary>Returns the result of a componentwise subtraction operation on a double3x2 matrix and a double value.</summary>
  210. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise subtraction.</param>
  211. /// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
  212. /// <returns>double3x2 result of the componentwise subtraction.</returns>
  213. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  214. public static double3x2 operator - (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
  215. /// <summary>Returns the result of a componentwise subtraction operation on a double value and a double3x2 matrix.</summary>
  216. /// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
  217. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise subtraction.</param>
  218. /// <returns>double3x2 result of the componentwise subtraction.</returns>
  219. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  220. public static double3x2 operator - (double lhs, double3x2 rhs) { return new double3x2 (lhs - rhs.c0, lhs - rhs.c1); }
  221. /// <summary>Returns the result of a componentwise division operation on two double3x2 matrices.</summary>
  222. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise division.</param>
  223. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise division.</param>
  224. /// <returns>double3x2 result of the componentwise division.</returns>
  225. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  226. public static double3x2 operator / (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
  227. /// <summary>Returns the result of a componentwise division operation on a double3x2 matrix and a double value.</summary>
  228. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise division.</param>
  229. /// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
  230. /// <returns>double3x2 result of the componentwise division.</returns>
  231. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  232. public static double3x2 operator / (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
  233. /// <summary>Returns the result of a componentwise division operation on a double value and a double3x2 matrix.</summary>
  234. /// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
  235. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise division.</param>
  236. /// <returns>double3x2 result of the componentwise division.</returns>
  237. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  238. public static double3x2 operator / (double lhs, double3x2 rhs) { return new double3x2 (lhs / rhs.c0, lhs / rhs.c1); }
  239. /// <summary>Returns the result of a componentwise modulus operation on two double3x2 matrices.</summary>
  240. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise modulus.</param>
  241. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise modulus.</param>
  242. /// <returns>double3x2 result of the componentwise modulus.</returns>
  243. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  244. public static double3x2 operator % (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
  245. /// <summary>Returns the result of a componentwise modulus operation on a double3x2 matrix and a double value.</summary>
  246. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise modulus.</param>
  247. /// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
  248. /// <returns>double3x2 result of the componentwise modulus.</returns>
  249. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  250. public static double3x2 operator % (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
  251. /// <summary>Returns the result of a componentwise modulus operation on a double value and a double3x2 matrix.</summary>
  252. /// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
  253. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise modulus.</param>
  254. /// <returns>double3x2 result of the componentwise modulus.</returns>
  255. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  256. public static double3x2 operator % (double lhs, double3x2 rhs) { return new double3x2 (lhs % rhs.c0, lhs % rhs.c1); }
  257. /// <summary>Returns the result of a componentwise increment operation on a double3x2 matrix.</summary>
  258. /// <param name="val">Value to use when computing the componentwise increment.</param>
  259. /// <returns>double3x2 result of the componentwise increment.</returns>
  260. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  261. public static double3x2 operator ++ (double3x2 val) { return new double3x2 (++val.c0, ++val.c1); }
  262. /// <summary>Returns the result of a componentwise decrement operation on a double3x2 matrix.</summary>
  263. /// <param name="val">Value to use when computing the componentwise decrement.</param>
  264. /// <returns>double3x2 result of the componentwise decrement.</returns>
  265. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  266. public static double3x2 operator -- (double3x2 val) { return new double3x2 (--val.c0, --val.c1); }
  267. /// <summary>Returns the result of a componentwise less than operation on two double3x2 matrices.</summary>
  268. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise less than.</param>
  269. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise less than.</param>
  270. /// <returns>bool3x2 result of the componentwise less than.</returns>
  271. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  272. public static bool3x2 operator < (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
  273. /// <summary>Returns the result of a componentwise less than operation on a double3x2 matrix and a double value.</summary>
  274. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise less than.</param>
  275. /// <param name="rhs">Right hand side double to use to compute componentwise less than.</param>
  276. /// <returns>bool3x2 result of the componentwise less than.</returns>
  277. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  278. public static bool3x2 operator < (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
  279. /// <summary>Returns the result of a componentwise less than operation on a double value and a double3x2 matrix.</summary>
  280. /// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
  281. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise less than.</param>
  282. /// <returns>bool3x2 result of the componentwise less than.</returns>
  283. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  284. public static bool3x2 operator < (double lhs, double3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); }
  285. /// <summary>Returns the result of a componentwise less or equal operation on two double3x2 matrices.</summary>
  286. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise less or equal.</param>
  287. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise less or equal.</param>
  288. /// <returns>bool3x2 result of the componentwise less or equal.</returns>
  289. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  290. public static bool3x2 operator <= (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
  291. /// <summary>Returns the result of a componentwise less or equal operation on a double3x2 matrix and a double value.</summary>
  292. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise less or equal.</param>
  293. /// <param name="rhs">Right hand side double to use to compute componentwise less or equal.</param>
  294. /// <returns>bool3x2 result of the componentwise less or equal.</returns>
  295. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  296. public static bool3x2 operator <= (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
  297. /// <summary>Returns the result of a componentwise less or equal operation on a double value and a double3x2 matrix.</summary>
  298. /// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
  299. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise less or equal.</param>
  300. /// <returns>bool3x2 result of the componentwise less or equal.</returns>
  301. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  302. public static bool3x2 operator <= (double lhs, double3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
  303. /// <summary>Returns the result of a componentwise greater than operation on two double3x2 matrices.</summary>
  304. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise greater than.</param>
  305. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise greater than.</param>
  306. /// <returns>bool3x2 result of the componentwise greater than.</returns>
  307. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  308. public static bool3x2 operator > (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
  309. /// <summary>Returns the result of a componentwise greater than operation on a double3x2 matrix and a double value.</summary>
  310. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise greater than.</param>
  311. /// <param name="rhs">Right hand side double to use to compute componentwise greater than.</param>
  312. /// <returns>bool3x2 result of the componentwise greater than.</returns>
  313. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  314. public static bool3x2 operator > (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
  315. /// <summary>Returns the result of a componentwise greater than operation on a double value and a double3x2 matrix.</summary>
  316. /// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
  317. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise greater than.</param>
  318. /// <returns>bool3x2 result of the componentwise greater than.</returns>
  319. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  320. public static bool3x2 operator > (double lhs, double3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); }
  321. /// <summary>Returns the result of a componentwise greater or equal operation on two double3x2 matrices.</summary>
  322. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise greater or equal.</param>
  323. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise greater or equal.</param>
  324. /// <returns>bool3x2 result of the componentwise greater or equal.</returns>
  325. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  326. public static bool3x2 operator >= (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
  327. /// <summary>Returns the result of a componentwise greater or equal operation on a double3x2 matrix and a double value.</summary>
  328. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise greater or equal.</param>
  329. /// <param name="rhs">Right hand side double to use to compute componentwise greater or equal.</param>
  330. /// <returns>bool3x2 result of the componentwise greater or equal.</returns>
  331. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  332. public static bool3x2 operator >= (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
  333. /// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double3x2 matrix.</summary>
  334. /// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
  335. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise greater or equal.</param>
  336. /// <returns>bool3x2 result of the componentwise greater or equal.</returns>
  337. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  338. public static bool3x2 operator >= (double lhs, double3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
  339. /// <summary>Returns the result of a componentwise unary minus operation on a double3x2 matrix.</summary>
  340. /// <param name="val">Value to use when computing the componentwise unary minus.</param>
  341. /// <returns>double3x2 result of the componentwise unary minus.</returns>
  342. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  343. public static double3x2 operator - (double3x2 val) { return new double3x2 (-val.c0, -val.c1); }
  344. /// <summary>Returns the result of a componentwise unary plus operation on a double3x2 matrix.</summary>
  345. /// <param name="val">Value to use when computing the componentwise unary plus.</param>
  346. /// <returns>double3x2 result of the componentwise unary plus.</returns>
  347. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  348. public static double3x2 operator + (double3x2 val) { return new double3x2 (+val.c0, +val.c1); }
  349. /// <summary>Returns the result of a componentwise equality operation on two double3x2 matrices.</summary>
  350. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise equality.</param>
  351. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise equality.</param>
  352. /// <returns>bool3x2 result of the componentwise equality.</returns>
  353. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  354. public static bool3x2 operator == (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
  355. /// <summary>Returns the result of a componentwise equality operation on a double3x2 matrix and a double value.</summary>
  356. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise equality.</param>
  357. /// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
  358. /// <returns>bool3x2 result of the componentwise equality.</returns>
  359. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  360. public static bool3x2 operator == (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
  361. /// <summary>Returns the result of a componentwise equality operation on a double value and a double3x2 matrix.</summary>
  362. /// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
  363. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise equality.</param>
  364. /// <returns>bool3x2 result of the componentwise equality.</returns>
  365. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  366. public static bool3x2 operator == (double lhs, double3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); }
  367. /// <summary>Returns the result of a componentwise not equal operation on two double3x2 matrices.</summary>
  368. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise not equal.</param>
  369. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise not equal.</param>
  370. /// <returns>bool3x2 result of the componentwise not equal.</returns>
  371. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  372. public static bool3x2 operator != (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
  373. /// <summary>Returns the result of a componentwise not equal operation on a double3x2 matrix and a double value.</summary>
  374. /// <param name="lhs">Left hand side double3x2 to use to compute componentwise not equal.</param>
  375. /// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
  376. /// <returns>bool3x2 result of the componentwise not equal.</returns>
  377. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  378. public static bool3x2 operator != (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
  379. /// <summary>Returns the result of a componentwise not equal operation on a double value and a double3x2 matrix.</summary>
  380. /// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
  381. /// <param name="rhs">Right hand side double3x2 to use to compute componentwise not equal.</param>
  382. /// <returns>bool3x2 result of the componentwise not equal.</returns>
  383. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  384. public static bool3x2 operator != (double lhs, double3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); }
  385. /// <summary>Returns the double3 element at a specified index.</summary>
  386. unsafe public ref double3 this[int index]
  387. {
  388. get
  389. {
  390. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  391. if ((uint)index >= 2)
  392. throw new System.ArgumentException("index must be between[0...1]");
  393. #endif
  394. fixed (double3x2* array = &this) { return ref ((double3*)array)[index]; }
  395. }
  396. }
  397. /// <summary>Returns true if the double3x2 is equal to a given double3x2, false otherwise.</summary>
  398. /// <param name="rhs">Right hand side argument to compare equality with.</param>
  399. /// <returns>The result of the equality comparison.</returns>
  400. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  401. public bool Equals(double3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
  402. /// <summary>Returns true if the double3x2 is equal to a given double3x2, false otherwise.</summary>
  403. /// <param name="o">Right hand side argument to compare equality with.</param>
  404. /// <returns>The result of the equality comparison.</returns>
  405. public override bool Equals(object o) { return o is double3x2 converted && Equals(converted); }
  406. /// <summary>Returns a hash code for the double3x2.</summary>
  407. /// <returns>The computed hash code.</returns>
  408. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  409. public override int GetHashCode() { return (int)math.hash(this); }
  410. /// <summary>Returns a string representation of the double3x2.</summary>
  411. /// <returns>String representation of the value.</returns>
  412. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  413. public override string ToString()
  414. {
  415. return string.Format("double3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z);
  416. }
  417. /// <summary>Returns a string representation of the double3x2 using a specified format and culture-specific format information.</summary>
  418. /// <param name="format">Format string to use during string formatting.</param>
  419. /// <param name="formatProvider">Format provider to use during string formatting.</param>
  420. /// <returns>String representation of the value.</returns>
  421. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  422. public string ToString(string format, IFormatProvider formatProvider)
  423. {
  424. return string.Format("double3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider));
  425. }
  426. }
  427. public static partial class math
  428. {
  429. /// <summary>Returns a double3x2 matrix constructed from two double3 vectors.</summary>
  430. /// <param name="c0">The matrix column c0 will be set to this value.</param>
  431. /// <param name="c1">The matrix column c1 will be set to this value.</param>
  432. /// <returns>double3x2 constructed from arguments.</returns>
  433. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  434. public static double3x2 double3x2(double3 c0, double3 c1) { return new double3x2(c0, c1); }
  435. /// <summary>Returns a double3x2 matrix constructed from from 6 double values given in row-major order.</summary>
  436. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  437. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  438. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  439. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  440. /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
  441. /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
  442. /// <returns>double3x2 constructed from arguments.</returns>
  443. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  444. public static double3x2 double3x2(double m00, double m01,
  445. double m10, double m11,
  446. double m20, double m21)
  447. {
  448. return new double3x2(m00, m01,
  449. m10, m11,
  450. m20, m21);
  451. }
  452. /// <summary>Returns a double3x2 matrix constructed from a single double value by assigning it to every component.</summary>
  453. /// <param name="v">double to convert to double3x2</param>
  454. /// <returns>Converted value.</returns>
  455. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  456. public static double3x2 double3x2(double v) { return new double3x2(v); }
  457. /// <summary>Returns a double3x2 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
  458. /// <param name="v">bool to convert to double3x2</param>
  459. /// <returns>Converted value.</returns>
  460. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  461. public static double3x2 double3x2(bool v) { return new double3x2(v); }
  462. /// <summary>Return a double3x2 matrix constructed from a bool3x2 matrix by componentwise conversion.</summary>
  463. /// <param name="v">bool3x2 to convert to double3x2</param>
  464. /// <returns>Converted value.</returns>
  465. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  466. public static double3x2 double3x2(bool3x2 v) { return new double3x2(v); }
  467. /// <summary>Returns a double3x2 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
  468. /// <param name="v">int to convert to double3x2</param>
  469. /// <returns>Converted value.</returns>
  470. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  471. public static double3x2 double3x2(int v) { return new double3x2(v); }
  472. /// <summary>Return a double3x2 matrix constructed from a int3x2 matrix by componentwise conversion.</summary>
  473. /// <param name="v">int3x2 to convert to double3x2</param>
  474. /// <returns>Converted value.</returns>
  475. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  476. public static double3x2 double3x2(int3x2 v) { return new double3x2(v); }
  477. /// <summary>Returns a double3x2 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
  478. /// <param name="v">uint to convert to double3x2</param>
  479. /// <returns>Converted value.</returns>
  480. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  481. public static double3x2 double3x2(uint v) { return new double3x2(v); }
  482. /// <summary>Return a double3x2 matrix constructed from a uint3x2 matrix by componentwise conversion.</summary>
  483. /// <param name="v">uint3x2 to convert to double3x2</param>
  484. /// <returns>Converted value.</returns>
  485. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  486. public static double3x2 double3x2(uint3x2 v) { return new double3x2(v); }
  487. /// <summary>Returns a double3x2 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
  488. /// <param name="v">float to convert to double3x2</param>
  489. /// <returns>Converted value.</returns>
  490. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  491. public static double3x2 double3x2(float v) { return new double3x2(v); }
  492. /// <summary>Return a double3x2 matrix constructed from a float3x2 matrix by componentwise conversion.</summary>
  493. /// <param name="v">float3x2 to convert to double3x2</param>
  494. /// <returns>Converted value.</returns>
  495. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  496. public static double3x2 double3x2(float3x2 v) { return new double3x2(v); }
  497. /// <summary>Return the double2x3 transpose of a double3x2 matrix.</summary>
  498. /// <param name="v">Value to transpose.</param>
  499. /// <returns>Transposed value.</returns>
  500. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  501. public static double2x3 transpose(double3x2 v)
  502. {
  503. return double2x3(
  504. v.c0.x, v.c0.y, v.c0.z,
  505. v.c1.x, v.c1.y, v.c1.z);
  506. }
  507. /// <summary>Returns a uint hash code of a double3x2 matrix.</summary>
  508. /// <param name="v">Matrix value to hash.</param>
  509. /// <returns>uint hash of the argument.</returns>
  510. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  511. public static uint hash(double3x2 v)
  512. {
  513. return csum(fold_to_uint(v.c0) * uint3(0xEE390C97u, 0x9C8A2F05u, 0x4DDC6509u) +
  514. fold_to_uint(v.c1) * uint3(0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u)) + 0xE857DCE1u;
  515. }
  516. /// <summary>
  517. /// Returns a uint3 vector hash code of a double3x2 matrix.
  518. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  519. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  520. /// </summary>
  521. /// <param name="v">Matrix value to hash.</param>
  522. /// <returns>uint3 hash of the argument.</returns>
  523. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  524. public static uint3 hashwide(double3x2 v)
  525. {
  526. return (fold_to_uint(v.c0) * uint3(0xF62213C5u, 0x9CDAA959u, 0xAA269ABFu) +
  527. fold_to_uint(v.c1) * uint3(0xD54BA36Fu, 0xFD0847B9u, 0x8189A683u)) + 0xB139D651u;
  528. }
  529. }
  530. }