Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

double3x3.gen.cs 44KB

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