float3x2.gen.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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 float3x2 : System.IEquatable<float3x2>, IFormattable
  16. {
  17. public float3 c0;
  18. public float3 c1;
  19. /// <summary>float3x2 zero value.</summary>
  20. public static readonly float3x2 zero;
  21. /// <summary>Constructs a float3x2 matrix from two float3 vectors.</summary>
  22. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  23. public float3x2(float3 c0, float3 c1)
  24. {
  25. this.c0 = c0;
  26. this.c1 = c1;
  27. }
  28. /// <summary>Constructs a float3x2 matrix from 6 float values given in row-major order.</summary>
  29. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  30. public float3x2(float m00, float m01,
  31. float m10, float m11,
  32. float m20, float m21)
  33. {
  34. this.c0 = new float3(m00, m10, m20);
  35. this.c1 = new float3(m01, m11, m21);
  36. }
  37. /// <summary>Constructs a float3x2 matrix from a single float value by assigning it to every component.</summary>
  38. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  39. public float3x2(float v)
  40. {
  41. this.c0 = v;
  42. this.c1 = v;
  43. }
  44. /// <summary>Constructs a float3x2 matrix from a single bool value by converting it to float and assigning it to every component.</summary>
  45. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  46. public float3x2(bool v)
  47. {
  48. this.c0 = math.select(new float3(0.0f), new float3(1.0f), v);
  49. this.c1 = math.select(new float3(0.0f), new float3(1.0f), v);
  50. }
  51. /// <summary>Constructs a float3x2 matrix from a bool3x2 matrix by componentwise conversion.</summary>
  52. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  53. public float3x2(bool3x2 v)
  54. {
  55. this.c0 = math.select(new float3(0.0f), new float3(1.0f), v.c0);
  56. this.c1 = math.select(new float3(0.0f), new float3(1.0f), v.c1);
  57. }
  58. /// <summary>Constructs a float3x2 matrix from a single int value by converting it to float and assigning it to every component.</summary>
  59. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  60. public float3x2(int v)
  61. {
  62. this.c0 = v;
  63. this.c1 = v;
  64. }
  65. /// <summary>Constructs a float3x2 matrix from a int3x2 matrix by componentwise conversion.</summary>
  66. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  67. public float3x2(int3x2 v)
  68. {
  69. this.c0 = v.c0;
  70. this.c1 = v.c1;
  71. }
  72. /// <summary>Constructs a float3x2 matrix from a single uint value by converting it to float and assigning it to every component.</summary>
  73. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  74. public float3x2(uint v)
  75. {
  76. this.c0 = v;
  77. this.c1 = v;
  78. }
  79. /// <summary>Constructs a float3x2 matrix from a uint3x2 matrix by componentwise conversion.</summary>
  80. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  81. public float3x2(uint3x2 v)
  82. {
  83. this.c0 = v.c0;
  84. this.c1 = v.c1;
  85. }
  86. /// <summary>Constructs a float3x2 matrix from a single double value by converting it to float and assigning it to every component.</summary>
  87. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  88. public float3x2(double v)
  89. {
  90. this.c0 = (float3)v;
  91. this.c1 = (float3)v;
  92. }
  93. /// <summary>Constructs a float3x2 matrix from a double3x2 matrix by componentwise conversion.</summary>
  94. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  95. public float3x2(double3x2 v)
  96. {
  97. this.c0 = (float3)v.c0;
  98. this.c1 = (float3)v.c1;
  99. }
  100. /// <summary>Implicitly converts a single float value to a float3x2 matrix by assigning it to every component.</summary>
  101. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  102. public static implicit operator float3x2(float v) { return new float3x2(v); }
  103. /// <summary>Explicitly converts a single bool value to a float3x2 matrix by converting it to float and assigning it to every component.</summary>
  104. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  105. public static explicit operator float3x2(bool v) { return new float3x2(v); }
  106. /// <summary>Explicitly converts a bool3x2 matrix to a float3x2 matrix by componentwise conversion.</summary>
  107. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  108. public static explicit operator float3x2(bool3x2 v) { return new float3x2(v); }
  109. /// <summary>Implicitly converts a single int value to a float3x2 matrix by converting it to float and assigning it to every component.</summary>
  110. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  111. public static implicit operator float3x2(int v) { return new float3x2(v); }
  112. /// <summary>Implicitly converts a int3x2 matrix to a float3x2 matrix by componentwise conversion.</summary>
  113. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  114. public static implicit operator float3x2(int3x2 v) { return new float3x2(v); }
  115. /// <summary>Implicitly converts a single uint value to a float3x2 matrix by converting it to float and assigning it to every component.</summary>
  116. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  117. public static implicit operator float3x2(uint v) { return new float3x2(v); }
  118. /// <summary>Implicitly converts a uint3x2 matrix to a float3x2 matrix by componentwise conversion.</summary>
  119. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  120. public static implicit operator float3x2(uint3x2 v) { return new float3x2(v); }
  121. /// <summary>Explicitly converts a single double value to a float3x2 matrix by converting it to float and assigning it to every component.</summary>
  122. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  123. public static explicit operator float3x2(double v) { return new float3x2(v); }
  124. /// <summary>Explicitly converts a double3x2 matrix to a float3x2 matrix by componentwise conversion.</summary>
  125. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  126. public static explicit operator float3x2(double3x2 v) { return new float3x2(v); }
  127. /// <summary>Returns the result of a componentwise multiplication operation on two float3x2 matrices.</summary>
  128. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  129. public static float3x2 operator * (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
  130. /// <summary>Returns the result of a componentwise multiplication operation on a float3x2 matrix and a float value.</summary>
  131. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  132. public static float3x2 operator * (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
  133. /// <summary>Returns the result of a componentwise multiplication operation on a float value and a float3x2 matrix.</summary>
  134. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  135. public static float3x2 operator * (float lhs, float3x2 rhs) { return new float3x2 (lhs * rhs.c0, lhs * rhs.c1); }
  136. /// <summary>Returns the result of a componentwise addition operation on two float3x2 matrices.</summary>
  137. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  138. public static float3x2 operator + (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
  139. /// <summary>Returns the result of a componentwise addition operation on a float3x2 matrix and a float value.</summary>
  140. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  141. public static float3x2 operator + (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
  142. /// <summary>Returns the result of a componentwise addition operation on a float value and a float3x2 matrix.</summary>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public static float3x2 operator + (float lhs, float3x2 rhs) { return new float3x2 (lhs + rhs.c0, lhs + rhs.c1); }
  145. /// <summary>Returns the result of a componentwise subtraction operation on two float3x2 matrices.</summary>
  146. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  147. public static float3x2 operator - (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
  148. /// <summary>Returns the result of a componentwise subtraction operation on a float3x2 matrix and a float value.</summary>
  149. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  150. public static float3x2 operator - (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
  151. /// <summary>Returns the result of a componentwise subtraction operation on a float value and a float3x2 matrix.</summary>
  152. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  153. public static float3x2 operator - (float lhs, float3x2 rhs) { return new float3x2 (lhs - rhs.c0, lhs - rhs.c1); }
  154. /// <summary>Returns the result of a componentwise division operation on two float3x2 matrices.</summary>
  155. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  156. public static float3x2 operator / (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
  157. /// <summary>Returns the result of a componentwise division operation on a float3x2 matrix and a float value.</summary>
  158. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  159. public static float3x2 operator / (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
  160. /// <summary>Returns the result of a componentwise division operation on a float value and a float3x2 matrix.</summary>
  161. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  162. public static float3x2 operator / (float lhs, float3x2 rhs) { return new float3x2 (lhs / rhs.c0, lhs / rhs.c1); }
  163. /// <summary>Returns the result of a componentwise modulus operation on two float3x2 matrices.</summary>
  164. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  165. public static float3x2 operator % (float3x2 lhs, float3x2 rhs) { return new float3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
  166. /// <summary>Returns the result of a componentwise modulus operation on a float3x2 matrix and a float value.</summary>
  167. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  168. public static float3x2 operator % (float3x2 lhs, float rhs) { return new float3x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
  169. /// <summary>Returns the result of a componentwise modulus operation on a float value and a float3x2 matrix.</summary>
  170. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  171. public static float3x2 operator % (float lhs, float3x2 rhs) { return new float3x2 (lhs % rhs.c0, lhs % rhs.c1); }
  172. /// <summary>Returns the result of a componentwise increment operation on a float3x2 matrix.</summary>
  173. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  174. public static float3x2 operator ++ (float3x2 val) { return new float3x2 (++val.c0, ++val.c1); }
  175. /// <summary>Returns the result of a componentwise decrement operation on a float3x2 matrix.</summary>
  176. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  177. public static float3x2 operator -- (float3x2 val) { return new float3x2 (--val.c0, --val.c1); }
  178. /// <summary>Returns the result of a componentwise less than operation on two float3x2 matrices.</summary>
  179. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  180. public static bool3x2 operator < (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
  181. /// <summary>Returns the result of a componentwise less than operation on a float3x2 matrix and a float value.</summary>
  182. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  183. public static bool3x2 operator < (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
  184. /// <summary>Returns the result of a componentwise less than operation on a float value and a float3x2 matrix.</summary>
  185. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  186. public static bool3x2 operator < (float lhs, float3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); }
  187. /// <summary>Returns the result of a componentwise less or equal operation on two float3x2 matrices.</summary>
  188. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  189. public static bool3x2 operator <= (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
  190. /// <summary>Returns the result of a componentwise less or equal operation on a float3x2 matrix and a float value.</summary>
  191. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  192. public static bool3x2 operator <= (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
  193. /// <summary>Returns the result of a componentwise less or equal operation on a float value and a float3x2 matrix.</summary>
  194. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  195. public static bool3x2 operator <= (float lhs, float3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
  196. /// <summary>Returns the result of a componentwise greater than operation on two float3x2 matrices.</summary>
  197. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  198. public static bool3x2 operator > (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
  199. /// <summary>Returns the result of a componentwise greater than operation on a float3x2 matrix and a float value.</summary>
  200. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  201. public static bool3x2 operator > (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
  202. /// <summary>Returns the result of a componentwise greater than operation on a float value and a float3x2 matrix.</summary>
  203. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  204. public static bool3x2 operator > (float lhs, float3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); }
  205. /// <summary>Returns the result of a componentwise greater or equal operation on two float3x2 matrices.</summary>
  206. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  207. public static bool3x2 operator >= (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
  208. /// <summary>Returns the result of a componentwise greater or equal operation on a float3x2 matrix and a float value.</summary>
  209. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  210. public static bool3x2 operator >= (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
  211. /// <summary>Returns the result of a componentwise greater or equal operation on a float value and a float3x2 matrix.</summary>
  212. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  213. public static bool3x2 operator >= (float lhs, float3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
  214. /// <summary>Returns the result of a componentwise unary minus operation on a float3x2 matrix.</summary>
  215. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  216. public static float3x2 operator - (float3x2 val) { return new float3x2 (-val.c0, -val.c1); }
  217. /// <summary>Returns the result of a componentwise unary plus operation on a float3x2 matrix.</summary>
  218. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  219. public static float3x2 operator + (float3x2 val) { return new float3x2 (+val.c0, +val.c1); }
  220. /// <summary>Returns the result of a componentwise equality operation on two float3x2 matrices.</summary>
  221. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  222. public static bool3x2 operator == (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
  223. /// <summary>Returns the result of a componentwise equality operation on a float3x2 matrix and a float value.</summary>
  224. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  225. public static bool3x2 operator == (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
  226. /// <summary>Returns the result of a componentwise equality operation on a float value and a float3x2 matrix.</summary>
  227. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  228. public static bool3x2 operator == (float lhs, float3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); }
  229. /// <summary>Returns the result of a componentwise not equal operation on two float3x2 matrices.</summary>
  230. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  231. public static bool3x2 operator != (float3x2 lhs, float3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
  232. /// <summary>Returns the result of a componentwise not equal operation on a float3x2 matrix and a float value.</summary>
  233. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  234. public static bool3x2 operator != (float3x2 lhs, float rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
  235. /// <summary>Returns the result of a componentwise not equal operation on a float value and a float3x2 matrix.</summary>
  236. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  237. public static bool3x2 operator != (float lhs, float3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); }
  238. /// <summary>Returns the float3 element at a specified index.</summary>
  239. unsafe public ref float3 this[int index]
  240. {
  241. get
  242. {
  243. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  244. if ((uint)index >= 2)
  245. throw new System.ArgumentException("index must be between[0...1]");
  246. #endif
  247. fixed (float3x2* array = &this) { return ref ((float3*)array)[index]; }
  248. }
  249. }
  250. /// <summary>Returns true if the float3x2 is equal to a given float3x2, false otherwise.</summary>
  251. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  252. public bool Equals(float3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
  253. /// <summary>Returns true if the float3x2 is equal to a given float3x2, false otherwise.</summary>
  254. public override bool Equals(object o) { return Equals((float3x2)o); }
  255. /// <summary>Returns a hash code for the float3x2.</summary>
  256. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  257. public override int GetHashCode() { return (int)math.hash(this); }
  258. /// <summary>Returns a string representation of the float3x2.</summary>
  259. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  260. public override string ToString()
  261. {
  262. return string.Format("float3x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z);
  263. }
  264. /// <summary>Returns a string representation of the float3x2 using a specified format and culture-specific format information.</summary>
  265. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  266. public string ToString(string format, IFormatProvider formatProvider)
  267. {
  268. return string.Format("float3x2({0}f, {1}f, {2}f, {3}f, {4}f, {5}f)", 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));
  269. }
  270. }
  271. public static partial class math
  272. {
  273. /// <summary>Returns a float3x2 matrix constructed from two float3 vectors.</summary>
  274. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  275. public static float3x2 float3x2(float3 c0, float3 c1) { return new float3x2(c0, c1); }
  276. /// <summary>Returns a float3x2 matrix constructed from from 6 float values given in row-major order.</summary>
  277. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  278. public static float3x2 float3x2(float m00, float m01,
  279. float m10, float m11,
  280. float m20, float m21)
  281. {
  282. return new float3x2(m00, m01,
  283. m10, m11,
  284. m20, m21);
  285. }
  286. /// <summary>Returns a float3x2 matrix constructed from a single float value by assigning it to every component.</summary>
  287. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  288. public static float3x2 float3x2(float v) { return new float3x2(v); }
  289. /// <summary>Returns a float3x2 matrix constructed from a single bool value by converting it to float and assigning it to every component.</summary>
  290. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  291. public static float3x2 float3x2(bool v) { return new float3x2(v); }
  292. /// <summary>Return a float3x2 matrix constructed from a bool3x2 matrix by componentwise conversion.</summary>
  293. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  294. public static float3x2 float3x2(bool3x2 v) { return new float3x2(v); }
  295. /// <summary>Returns a float3x2 matrix constructed from a single int value by converting it to float and assigning it to every component.</summary>
  296. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  297. public static float3x2 float3x2(int v) { return new float3x2(v); }
  298. /// <summary>Return a float3x2 matrix constructed from a int3x2 matrix by componentwise conversion.</summary>
  299. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  300. public static float3x2 float3x2(int3x2 v) { return new float3x2(v); }
  301. /// <summary>Returns a float3x2 matrix constructed from a single uint value by converting it to float and assigning it to every component.</summary>
  302. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  303. public static float3x2 float3x2(uint v) { return new float3x2(v); }
  304. /// <summary>Return a float3x2 matrix constructed from a uint3x2 matrix by componentwise conversion.</summary>
  305. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  306. public static float3x2 float3x2(uint3x2 v) { return new float3x2(v); }
  307. /// <summary>Returns a float3x2 matrix constructed from a single double value by converting it to float and assigning it to every component.</summary>
  308. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  309. public static float3x2 float3x2(double v) { return new float3x2(v); }
  310. /// <summary>Return a float3x2 matrix constructed from a double3x2 matrix by componentwise conversion.</summary>
  311. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  312. public static float3x2 float3x2(double3x2 v) { return new float3x2(v); }
  313. /// <summary>Return the float2x3 transpose of a float3x2 matrix.</summary>
  314. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  315. public static float2x3 transpose(float3x2 v)
  316. {
  317. return float2x3(
  318. v.c0.x, v.c0.y, v.c0.z,
  319. v.c1.x, v.c1.y, v.c1.z);
  320. }
  321. /// <summary>Returns a uint hash code of a float3x2 vector.</summary>
  322. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  323. public static uint hash(float3x2 v)
  324. {
  325. return csum(asuint(v.c0) * uint3(0xE121E6ADu, 0xC9CA1249u, 0x69B60C81u) +
  326. asuint(v.c1) * uint3(0xE0EB6C25u, 0xF648BEABu, 0x6BDB2B07u)) + 0xEF63C699u;
  327. }
  328. /// <summary>
  329. /// Returns a uint3 vector hash code of a float3x2 vector.
  330. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  331. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  332. /// </summary>
  333. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  334. public static uint3 hashwide(float3x2 v)
  335. {
  336. return (asuint(v.c0) * uint3(0x9001903Fu, 0xA895B9CDu, 0x9D23B201u) +
  337. asuint(v.c1) * uint3(0x4B01D3E1u, 0x7461CA0Du, 0x79725379u)) + 0xD6258E5Bu;
  338. }
  339. }
  340. }