double3x4.gen.cs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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.
  7. // </auto-generated>
  8. //------------------------------------------------------------------------------
  9. using System;
  10. using System.Runtime.CompilerServices;
  11. #pragma warning disable 0660, 0661
  12. namespace Unity.Mathematics
  13. {
  14. [System.Serializable]
  15. public partial struct double3x4 : System.IEquatable<double3x4>, IFormattable
  16. {
  17. public double3 c0;
  18. public double3 c1;
  19. public double3 c2;
  20. public double3 c3;
  21. /// <summary>double3x4 zero value.</summary>
  22. public static readonly double3x4 zero;
  23. /// <summary>Constructs a double3x4 matrix from four double3 vectors.</summary>
  24. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  25. public double3x4(double3 c0, double3 c1, double3 c2, double3 c3)
  26. {
  27. this.c0 = c0;
  28. this.c1 = c1;
  29. this.c2 = c2;
  30. this.c3 = c3;
  31. }
  32. /// <summary>Constructs a double3x4 matrix from 12 double values given in row-major order.</summary>
  33. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  34. public double3x4(double m00, double m01, double m02, double m03,
  35. double m10, double m11, double m12, double m13,
  36. double m20, double m21, double m22, double m23)
  37. {
  38. this.c0 = new double3(m00, m10, m20);
  39. this.c1 = new double3(m01, m11, m21);
  40. this.c2 = new double3(m02, m12, m22);
  41. this.c3 = new double3(m03, m13, m23);
  42. }
  43. /// <summary>Constructs a double3x4 matrix from a single double value by assigning it to every component.</summary>
  44. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  45. public double3x4(double v)
  46. {
  47. this.c0 = v;
  48. this.c1 = v;
  49. this.c2 = v;
  50. this.c3 = v;
  51. }
  52. /// <summary>Constructs a double3x4 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
  53. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  54. public double3x4(bool v)
  55. {
  56. this.c0 = math.select(new double3(0.0), new double3(1.0), v);
  57. this.c1 = math.select(new double3(0.0), new double3(1.0), v);
  58. this.c2 = math.select(new double3(0.0), new double3(1.0), v);
  59. this.c3 = math.select(new double3(0.0), new double3(1.0), v);
  60. }
  61. /// <summary>Constructs a double3x4 matrix from a bool3x4 matrix by componentwise conversion.</summary>
  62. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  63. public double3x4(bool3x4 v)
  64. {
  65. this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0);
  66. this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1);
  67. this.c2 = math.select(new double3(0.0), new double3(1.0), v.c2);
  68. this.c3 = math.select(new double3(0.0), new double3(1.0), v.c3);
  69. }
  70. /// <summary>Constructs a double3x4 matrix from a single int value by converting it to double and assigning it to every component.</summary>
  71. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  72. public double3x4(int v)
  73. {
  74. this.c0 = v;
  75. this.c1 = v;
  76. this.c2 = v;
  77. this.c3 = v;
  78. }
  79. /// <summary>Constructs a double3x4 matrix from a int3x4 matrix by componentwise conversion.</summary>
  80. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  81. public double3x4(int3x4 v)
  82. {
  83. this.c0 = v.c0;
  84. this.c1 = v.c1;
  85. this.c2 = v.c2;
  86. this.c3 = v.c3;
  87. }
  88. /// <summary>Constructs a double3x4 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
  89. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  90. public double3x4(uint v)
  91. {
  92. this.c0 = v;
  93. this.c1 = v;
  94. this.c2 = v;
  95. this.c3 = v;
  96. }
  97. /// <summary>Constructs a double3x4 matrix from a uint3x4 matrix by componentwise conversion.</summary>
  98. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  99. public double3x4(uint3x4 v)
  100. {
  101. this.c0 = v.c0;
  102. this.c1 = v.c1;
  103. this.c2 = v.c2;
  104. this.c3 = v.c3;
  105. }
  106. /// <summary>Constructs a double3x4 matrix from a single float value by converting it to double and assigning it to every component.</summary>
  107. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  108. public double3x4(float v)
  109. {
  110. this.c0 = v;
  111. this.c1 = v;
  112. this.c2 = v;
  113. this.c3 = v;
  114. }
  115. /// <summary>Constructs a double3x4 matrix from a float3x4 matrix by componentwise conversion.</summary>
  116. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  117. public double3x4(float3x4 v)
  118. {
  119. this.c0 = v.c0;
  120. this.c1 = v.c1;
  121. this.c2 = v.c2;
  122. this.c3 = v.c3;
  123. }
  124. /// <summary>Implicitly converts a single double value to a double3x4 matrix by assigning it to every component.</summary>
  125. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  126. public static implicit operator double3x4(double v) { return new double3x4(v); }
  127. /// <summary>Explicitly converts a single bool value to a double3x4 matrix by converting it to double and assigning it to every component.</summary>
  128. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  129. public static explicit operator double3x4(bool v) { return new double3x4(v); }
  130. /// <summary>Explicitly converts a bool3x4 matrix to a double3x4 matrix by componentwise conversion.</summary>
  131. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  132. public static explicit operator double3x4(bool3x4 v) { return new double3x4(v); }
  133. /// <summary>Implicitly converts a single int value to a double3x4 matrix by converting it to double and assigning it to every component.</summary>
  134. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  135. public static implicit operator double3x4(int v) { return new double3x4(v); }
  136. /// <summary>Implicitly converts a int3x4 matrix to a double3x4 matrix by componentwise conversion.</summary>
  137. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  138. public static implicit operator double3x4(int3x4 v) { return new double3x4(v); }
  139. /// <summary>Implicitly converts a single uint value to a double3x4 matrix by converting it to double and assigning it to every component.</summary>
  140. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  141. public static implicit operator double3x4(uint v) { return new double3x4(v); }
  142. /// <summary>Implicitly converts a uint3x4 matrix to a double3x4 matrix by componentwise conversion.</summary>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public static implicit operator double3x4(uint3x4 v) { return new double3x4(v); }
  145. /// <summary>Implicitly converts a single float value to a double3x4 matrix by converting it to double and assigning it to every component.</summary>
  146. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  147. public static implicit operator double3x4(float v) { return new double3x4(v); }
  148. /// <summary>Implicitly converts a float3x4 matrix to a double3x4 matrix by componentwise conversion.</summary>
  149. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  150. public static implicit operator double3x4(float3x4 v) { return new double3x4(v); }
  151. /// <summary>Returns the result of a componentwise multiplication operation on two double3x4 matrices.</summary>
  152. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  153. public static double3x4 operator * (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
  154. /// <summary>Returns the result of a componentwise multiplication operation on a double3x4 matrix and a double value.</summary>
  155. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  156. public static double3x4 operator * (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
  157. /// <summary>Returns the result of a componentwise multiplication operation on a double value and a double3x4 matrix.</summary>
  158. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  159. public static double3x4 operator * (double lhs, double3x4 rhs) { return new double3x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
  160. /// <summary>Returns the result of a componentwise addition operation on two double3x4 matrices.</summary>
  161. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  162. public static double3x4 operator + (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
  163. /// <summary>Returns the result of a componentwise addition operation on a double3x4 matrix and a double value.</summary>
  164. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  165. public static double3x4 operator + (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
  166. /// <summary>Returns the result of a componentwise addition operation on a double value and a double3x4 matrix.</summary>
  167. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  168. public static double3x4 operator + (double lhs, double3x4 rhs) { return new double3x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
  169. /// <summary>Returns the result of a componentwise subtraction operation on two double3x4 matrices.</summary>
  170. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  171. public static double3x4 operator - (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
  172. /// <summary>Returns the result of a componentwise subtraction operation on a double3x4 matrix and a double value.</summary>
  173. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  174. public static double3x4 operator - (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
  175. /// <summary>Returns the result of a componentwise subtraction operation on a double value and a double3x4 matrix.</summary>
  176. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  177. public static double3x4 operator - (double lhs, double3x4 rhs) { return new double3x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
  178. /// <summary>Returns the result of a componentwise division operation on two double3x4 matrices.</summary>
  179. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  180. public static double3x4 operator / (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
  181. /// <summary>Returns the result of a componentwise division operation on a double3x4 matrix and a double value.</summary>
  182. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  183. public static double3x4 operator / (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
  184. /// <summary>Returns the result of a componentwise division operation on a double value and a double3x4 matrix.</summary>
  185. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  186. public static double3x4 operator / (double lhs, double3x4 rhs) { return new double3x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
  187. /// <summary>Returns the result of a componentwise modulus operation on two double3x4 matrices.</summary>
  188. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  189. public static double3x4 operator % (double3x4 lhs, double3x4 rhs) { return new double3x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
  190. /// <summary>Returns the result of a componentwise modulus operation on a double3x4 matrix and a double value.</summary>
  191. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  192. public static double3x4 operator % (double3x4 lhs, double rhs) { return new double3x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
  193. /// <summary>Returns the result of a componentwise modulus operation on a double value and a double3x4 matrix.</summary>
  194. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  195. public static double3x4 operator % (double lhs, double3x4 rhs) { return new double3x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
  196. /// <summary>Returns the result of a componentwise increment operation on a double3x4 matrix.</summary>
  197. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  198. public static double3x4 operator ++ (double3x4 val) { return new double3x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
  199. /// <summary>Returns the result of a componentwise decrement operation on a double3x4 matrix.</summary>
  200. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  201. public static double3x4 operator -- (double3x4 val) { return new double3x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
  202. /// <summary>Returns the result of a componentwise less than operation on two double3x4 matrices.</summary>
  203. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  204. public static bool3x4 operator < (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
  205. /// <summary>Returns the result of a componentwise less than operation on a double3x4 matrix and a double value.</summary>
  206. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  207. public static bool3x4 operator < (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
  208. /// <summary>Returns the result of a componentwise less than operation on a double value and a double3x4 matrix.</summary>
  209. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  210. public static bool3x4 operator < (double lhs, double3x4 rhs) { return new bool3x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
  211. /// <summary>Returns the result of a componentwise less or equal operation on two double3x4 matrices.</summary>
  212. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  213. public static bool3x4 operator <= (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
  214. /// <summary>Returns the result of a componentwise less or equal operation on a double3x4 matrix and a double value.</summary>
  215. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  216. public static bool3x4 operator <= (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
  217. /// <summary>Returns the result of a componentwise less or equal operation on a double value and a double3x4 matrix.</summary>
  218. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  219. public static bool3x4 operator <= (double lhs, double3x4 rhs) { return new bool3x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
  220. /// <summary>Returns the result of a componentwise greater than operation on two double3x4 matrices.</summary>
  221. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  222. public static bool3x4 operator > (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
  223. /// <summary>Returns the result of a componentwise greater than operation on a double3x4 matrix and a double value.</summary>
  224. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  225. public static bool3x4 operator > (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
  226. /// <summary>Returns the result of a componentwise greater than operation on a double value and a double3x4 matrix.</summary>
  227. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  228. public static bool3x4 operator > (double lhs, double3x4 rhs) { return new bool3x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
  229. /// <summary>Returns the result of a componentwise greater or equal operation on two double3x4 matrices.</summary>
  230. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  231. public static bool3x4 operator >= (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
  232. /// <summary>Returns the result of a componentwise greater or equal operation on a double3x4 matrix and a double value.</summary>
  233. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  234. public static bool3x4 operator >= (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
  235. /// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double3x4 matrix.</summary>
  236. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  237. public static bool3x4 operator >= (double lhs, double3x4 rhs) { return new bool3x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
  238. /// <summary>Returns the result of a componentwise unary minus operation on a double3x4 matrix.</summary>
  239. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  240. public static double3x4 operator - (double3x4 val) { return new double3x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
  241. /// <summary>Returns the result of a componentwise unary plus operation on a double3x4 matrix.</summary>
  242. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  243. public static double3x4 operator + (double3x4 val) { return new double3x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
  244. /// <summary>Returns the result of a componentwise equality operation on two double3x4 matrices.</summary>
  245. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  246. public static bool3x4 operator == (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
  247. /// <summary>Returns the result of a componentwise equality operation on a double3x4 matrix and a double value.</summary>
  248. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  249. public static bool3x4 operator == (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
  250. /// <summary>Returns the result of a componentwise equality operation on a double value and a double3x4 matrix.</summary>
  251. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  252. public static bool3x4 operator == (double lhs, double3x4 rhs) { return new bool3x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
  253. /// <summary>Returns the result of a componentwise not equal operation on two double3x4 matrices.</summary>
  254. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  255. public static bool3x4 operator != (double3x4 lhs, double3x4 rhs) { return new bool3x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
  256. /// <summary>Returns the result of a componentwise not equal operation on a double3x4 matrix and a double value.</summary>
  257. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  258. public static bool3x4 operator != (double3x4 lhs, double rhs) { return new bool3x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
  259. /// <summary>Returns the result of a componentwise not equal operation on a double value and a double3x4 matrix.</summary>
  260. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  261. public static bool3x4 operator != (double lhs, double3x4 rhs) { return new bool3x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
  262. /// <summary>Returns the double3 element at a specified index.</summary>
  263. unsafe public ref double3 this[int index]
  264. {
  265. get
  266. {
  267. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  268. if ((uint)index >= 4)
  269. throw new System.ArgumentException("index must be between[0...3]");
  270. #endif
  271. fixed (double3x4* array = &this) { return ref ((double3*)array)[index]; }
  272. }
  273. }
  274. /// <summary>Returns true if the double3x4 is equal to a given double3x4, false otherwise.</summary>
  275. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  276. public bool Equals(double3x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
  277. /// <summary>Returns true if the double3x4 is equal to a given double3x4, false otherwise.</summary>
  278. public override bool Equals(object o) { return Equals((double3x4)o); }
  279. /// <summary>Returns a hash code for the double3x4.</summary>
  280. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  281. public override int GetHashCode() { return (int)math.hash(this); }
  282. /// <summary>Returns a string representation of the double3x4.</summary>
  283. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  284. public override string ToString()
  285. {
  286. return string.Format("double3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y, c0.z, c1.z, c2.z, c3.z);
  287. }
  288. /// <summary>Returns a string representation of the double3x4 using a specified format and culture-specific format information.</summary>
  289. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  290. public string ToString(string format, IFormatProvider formatProvider)
  291. {
  292. return string.Format("double3x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider), c0.z.ToString(format, formatProvider), c1.z.ToString(format, formatProvider), c2.z.ToString(format, formatProvider), c3.z.ToString(format, formatProvider));
  293. }
  294. }
  295. public static partial class math
  296. {
  297. /// <summary>Returns a double3x4 matrix constructed from four double3 vectors.</summary>
  298. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  299. public static double3x4 double3x4(double3 c0, double3 c1, double3 c2, double3 c3) { return new double3x4(c0, c1, c2, c3); }
  300. /// <summary>Returns a double3x4 matrix constructed from from 12 double values given in row-major order.</summary>
  301. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  302. public static double3x4 double3x4(double m00, double m01, double m02, double m03,
  303. double m10, double m11, double m12, double m13,
  304. double m20, double m21, double m22, double m23)
  305. {
  306. return new double3x4(m00, m01, m02, m03,
  307. m10, m11, m12, m13,
  308. m20, m21, m22, m23);
  309. }
  310. /// <summary>Returns a double3x4 matrix constructed from a single double value by assigning it to every component.</summary>
  311. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  312. public static double3x4 double3x4(double v) { return new double3x4(v); }
  313. /// <summary>Returns a double3x4 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
  314. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  315. public static double3x4 double3x4(bool v) { return new double3x4(v); }
  316. /// <summary>Return a double3x4 matrix constructed from a bool3x4 matrix by componentwise conversion.</summary>
  317. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  318. public static double3x4 double3x4(bool3x4 v) { return new double3x4(v); }
  319. /// <summary>Returns a double3x4 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
  320. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  321. public static double3x4 double3x4(int v) { return new double3x4(v); }
  322. /// <summary>Return a double3x4 matrix constructed from a int3x4 matrix by componentwise conversion.</summary>
  323. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  324. public static double3x4 double3x4(int3x4 v) { return new double3x4(v); }
  325. /// <summary>Returns a double3x4 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
  326. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  327. public static double3x4 double3x4(uint v) { return new double3x4(v); }
  328. /// <summary>Return a double3x4 matrix constructed from a uint3x4 matrix by componentwise conversion.</summary>
  329. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  330. public static double3x4 double3x4(uint3x4 v) { return new double3x4(v); }
  331. /// <summary>Returns a double3x4 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
  332. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  333. public static double3x4 double3x4(float v) { return new double3x4(v); }
  334. /// <summary>Return a double3x4 matrix constructed from a float3x4 matrix by componentwise conversion.</summary>
  335. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  336. public static double3x4 double3x4(float3x4 v) { return new double3x4(v); }
  337. /// <summary>Return the double4x3 transpose of a double3x4 matrix.</summary>
  338. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  339. public static double4x3 transpose(double3x4 v)
  340. {
  341. return double4x3(
  342. v.c0.x, v.c0.y, v.c0.z,
  343. v.c1.x, v.c1.y, v.c1.z,
  344. v.c2.x, v.c2.y, v.c2.z,
  345. v.c3.x, v.c3.y, v.c3.z);
  346. }
  347. // Fast matrix inverse for rigid transforms (Orthonormal basis and translation)
  348. public static double3x4 fastinverse(double3x4 m)
  349. {
  350. double3 c0 = m.c0;
  351. double3 c1 = m.c1;
  352. double3 c2 = m.c2;
  353. double3 pos = m.c3;
  354. double3 r0 = double3(c0.x, c1.x, c2.x);
  355. double3 r1 = double3(c0.y, c1.y, c2.y);
  356. double3 r2 = double3(c0.z, c1.z, c2.z);
  357. pos = -(r0 * pos.x + r1 * pos.y + r2 * pos.z);
  358. return double3x4(r0, r1, r2, pos);
  359. }
  360. /// <summary>Returns a uint hash code of a double3x4 vector.</summary>
  361. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  362. public static uint hash(double3x4 v)
  363. {
  364. return csum(fold_to_uint(v.c0) * uint3(0xEE390C97u, 0x9C8A2F05u, 0x4DDC6509u) +
  365. fold_to_uint(v.c1) * uint3(0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u) +
  366. fold_to_uint(v.c2) * uint3(0xE857DCE1u, 0xF62213C5u, 0x9CDAA959u) +
  367. fold_to_uint(v.c3) * uint3(0xAA269ABFu, 0xD54BA36Fu, 0xFD0847B9u)) + 0x8189A683u;
  368. }
  369. /// <summary>
  370. /// Returns a uint3 vector hash code of a double3x4 vector.
  371. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  372. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  373. /// </summary>
  374. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  375. public static uint3 hashwide(double3x4 v)
  376. {
  377. return (fold_to_uint(v.c0) * uint3(0xB139D651u, 0xE7579997u, 0xEF7D56C7u) +
  378. fold_to_uint(v.c1) * uint3(0x66F38F0Bu, 0x624256A3u, 0x5292ADE1u) +
  379. fold_to_uint(v.c2) * uint3(0xD2E590E5u, 0xF25BE857u, 0x9BC17CE7u) +
  380. fold_to_uint(v.c3) * uint3(0xC8B86851u, 0x64095221u, 0xADF428FFu)) + 0xA3977109u;
  381. }
  382. }
  383. }