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