int2
A 2 component vector of ints.
Read time 4 minutesLast updated 4 days ago
Definition
- Type: Struct
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
- Implements: IEquatable<int2>, IFormattable
public struct int2 : IEquatable<int2>, IFormattable
Fields
Static Fields
Value | Description |
|---|---|
| zero | int2 zero value. |
Constructors
Constructor | Description |
|---|---|
| int2(System.Boolean) | Constructs a int2 vector from a single bool value by converting it to int and assigning it to every component. |
| int2(System.Double) | Constructs a int2 vector from a single double value by converting it to int and assigning it to every component. |
| int2(System.Int32) | Constructs a int2 vector from a single int value by assigning it to every component. |
| int2(System.Int32,System.Int32) | Constructs a int2 vector from two int values. |
| int2(System.Single) | Constructs a int2 vector from a single float value by converting it to int and assigning it to every component. |
| int2(System.UInt32) | Constructs a int2 vector from a single uint value by converting it to int and assigning it to every component. |
| int2(Unity.Mathematics.bool2) | Constructs a int2 vector from a bool2 vector by componentwise conversion. |
| int2(Unity.Mathematics.double2) | Constructs a int2 vector from a double2 vector by componentwise conversion. |
| int2(Unity.Mathematics.float2) | Constructs a int2 vector from a float2 vector by componentwise conversion. |
| int2(Unity.Mathematics.int2) | Constructs a int2 vector from an int2 vector. |
| int2(Unity.Mathematics.uint2) | Constructs a int2 vector from a uint2 vector by componentwise conversion. |
Properties
Property | Description |
|---|---|
| this[] | Returns the int element at a specified index. |
| xx | Swizzles the vector. |
| xxx | Swizzles the vector. |
| xxxx | Swizzles the vector. |
| xxxy | Swizzles the vector. |
| xxy | Swizzles the vector. |
| xxyx | Swizzles the vector. |
| xxyy | Swizzles the vector. |
| xy | Swizzles the vector. |
| xyx | Swizzles the vector. |
| xyxx | Swizzles the vector. |
| xyxy | Swizzles the vector. |
| xyy | Swizzles the vector. |
| xyyx | Swizzles the vector. |
| xyyy | Swizzles the vector. |
| yx | Swizzles the vector. |
| yxx | Swizzles the vector. |
| yxxx | Swizzles the vector. |
| yxxy | Swizzles the vector. |
| yxy | Swizzles the vector. |
| yxyx | Swizzles the vector. |
| yxyy | Swizzles the vector. |
| yy | Swizzles the vector. |
| yyx | Swizzles the vector. |
| yyxx | Swizzles the vector. |
| yyxy | Swizzles the vector. |
| yyy | Swizzles the vector. |
| yyyx | Swizzles the vector. |
| yyyy | Swizzles the vector. |
Methods
Method | Description |
|---|---|
| Equals | Returns true if the int2 is equal to a given int2, false otherwise. |
| GetHashCode | Returns a hash code for the int2. |
| ToString | Returns a string representation of the int2. |
Operators
Operator | Description |
|---|---|
| operator + | Returns the result of a componentwise addition operation on an int value and an int2 vector. |
| operator & | Returns the result of a componentwise bitwise and operation on an int value and an int2 vector. |
| operator | | Returns the result of a componentwise bitwise or operation on an int value and an int2 vector. |
| operator -- | Returns the result of a componentwise decrement operation on an int2 vector. |
| operator / | Returns the result of a componentwise division operation on an int value and an int2 vector. |
| operator == | Returns the result of a componentwise equality operation on an int value and an int2 vector. |
| operator ^ | Returns the result of a componentwise bitwise exclusive or operation on an int value and an int2 vector. |
| int2 | Explicitly converts a single bool value to a int2 vector by converting it to int and assigning it to every component. |
| operator > | Returns the result of a componentwise greater than operation on an int value and an int2 vector. |
| operator >= | Returns the result of a componentwise greater or equal operation on an int value and an int2 vector. |
| operator ++ | Returns the result of a componentwise increment operation on an int2 vector. |
| operator != | Returns the result of a componentwise not equal operation on an int value and an int2 vector. |
| operator << | Returns the result of a componentwise left shift operation on an int2 vector by a number of bits specified by a single int. |
| operator < | Returns the result of a componentwise less than operation on an int value and an int2 vector. |
| operator <= | Returns the result of a componentwise less or equal operation on an int value and an int2 vector. |
| operator % | Returns the result of a componentwise modulus operation on an int value and an int2 vector. |
| operator * | Returns the result of a componentwise multiplication operation on an int value and an int2 vector. |
| operator ~ | Returns the result of a componentwise bitwise not operation on an int2 vector. |
| operator >> | Returns the result of a componentwise right shift operation on an int2 vector by a number of bits specified by a single int. |
| operator - | Returns the result of a componentwise subtraction operation on an int value and an int2 vector. |