Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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