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